chore: update swag docs (#2178)

* chore: update swag docs

* chore: update
This commit is contained in:
boojack
2023-08-26 08:07:43 +08:00
committed by GitHub
parent ad1822d308
commit 18fb02a1ec
12 changed files with 546 additions and 28 deletions

View File

@@ -6,7 +6,7 @@
- Documentation is written using [Declarative Comments Format](https://github.com/swaggo/swag#declarative-comments-format).
- The documentation is generated in the `./api` folder as `docs.go`.
- The documentation is generated in the `./api/v1` folder as `docs.go`.
- [echo-swagger](https://github.com/swaggo/echo-swagger) is used to integrate with Echo framework and serve the documentation with [Swagger-UI](https://swagger.io/tools/swagger-ui/) at `http://memos.host:5230/api/index.html`
@@ -107,7 +107,7 @@ If `$HOME/go/bin` is not in your `PATH`, you can call `swag` directly at `$HOME/
```bash
cd <project-root>
swag init --output api --generalInfo ./server/server.go --dir ./,./api/v1
swag init --output ./api/v1 --generalInfo ./api/v1/v1.go --dir ./,./api/v1
```
> If the API gets a new version, you'll need to add the file system path to swag's `--dir` parameter.