fix(swagger): add generated swagger docs to repo

This commit is contained in:
kolaente 2023-09-06 18:01:45 +02:00
parent 985233ac38
commit 107b0b791f
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
7 changed files with 23257 additions and 27 deletions

View File

@ -349,6 +349,50 @@ steps:
when:
event: [ push, tag, pull_request ]
---
kind: pipeline
type: docker
name: generate-swagger-docs
depends_on:
- testing
workspace:
base: /go
path: src/code.vikunja.io/api
trigger:
branch:
include:
- main
event:
include:
- push
steps:
- name: generate-swagger-docs
image: vikunja/golang-build:latest
pull: always
environment:
GOPROXY: 'https://goproxy.kolaente.de'
commands:
- mage do-the-swag
- name: push
pull: always
image: appleboy/drone-git-push
depends_on:
- generate-swagger-docs
settings:
author_email: "frederik@vikunja.io"
author_name: Frederick [Bot]
branch: main
commit: true
commit_message: "[skip ci] Updated swagger docs"
remote: "ssh://git@kolaente.dev:9022/vikunja/api.git"
ssh_key:
from_secret: git_push_ssh_key
---
########
# Build a release when tagging
@ -743,6 +787,6 @@ steps:
- failure
---
kind: signature
hmac: d47bd1cf6f3e9be2ff3eed2039e65c8b6de2b16c1e636699f66382f941277411
hmac: 4b256850b13566216d4486598554f137a18d64d4bfc5727b09056639a9fafd3e
...

1
.gitignore vendored
View File

@ -27,4 +27,3 @@ vikunja-dump*
vendor/
os-packages/
mage_output_file.go
pkg/swagger/*

View File

@ -349,13 +349,7 @@ const swaggerDocsFolderLocation = `./pkg/swagger/`
// Generates the swagger docs from the code annotations
func DoTheSwag() {
mg.Deps(initVars)
if _, err := os.Stat(swaggerDocsFolderLocation + "swagger.json"); err == nil {
fmt.Println("Swagger docs already generated, not generating. Remove the files in " + swaggerDocsFolderLocation + " and run this command again to regenerate them.")
return
}
//runAndStreamOutput("go", "mod", "tidy")
//runAndStreamOutput("go", "mod", "download")
checkAndInstallGoTool("swag", "github.com/swaggo/swag/cmd/swag")
runAndStreamOutput("swag", "init", "-g", "./pkg/routes/routes.go", "--parseDependency", "-d", RootPath, "-o", RootPath+"/pkg/swagger")
}

8663
pkg/swagger/docs.go Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +0,0 @@
// Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-present Vikunja and contributors. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public Licensee as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public Licensee for more details.
//
// You should have received a copy of the GNU Affero General Public Licensee
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package swagger
// This file exists so that the package exists, and we're able to build Vikunja without the docs.

8638
pkg/swagger/swagger.json Normal file

File diff suppressed because it is too large Load Diff

5911
pkg/swagger/swagger.yaml Normal file

File diff suppressed because it is too large Load Diff