Conversation
| swag fmt -d ./api | ||
| go run v3gen/main.go | ||
| bash docs/fix_openapi_spec.sh | ||
| api-spec-converter --from=swagger_2 --to=openapi_3 -s yaml ./docs/swagger.yaml > ./docs/v3/openapi3.yaml |
There was a problem hiding this comment.
This hook now requires jq, yq, and api-spec-converter. Please add command -v checks with install hints so failures are clear for non-mise setups.
There was a problem hiding this comment.
We should not require anyone to install these on their machines imo. That's why the dependency manager exists. These tools will never run in CI or in prod, it will always run locally.
| bash docs/fix_openapi_spec.sh | ||
|
|
||
| #generate v3 specs | ||
| api-spec-converter --from=swagger_2 --to=openapi_3 -s yaml ./docs/swagger.yaml > ./docs/v3/openapi3.yaml |
There was a problem hiding this comment.
Looks good. Please add a small required-tools preflight (jq, yq, api-spec-converter) so it fails fast with a clear message.
There was a problem hiding this comment.
Same thing here. Forcing people to install a tool they'll only use to generate docs and making sure everyone is on the same version is a problem we struggled with for a long time and it makes no sense to keep supporting it
…reflight, and updated documentation scripts
| exit 0 | ||
| else | ||
| # check required tools | ||
| for tool in swag jq yq api-spec-converter openapi; do |
There was a problem hiding this comment.
Partially fixed. Tool checks were added, but openapi is now required in preflight and still not pinned in mise.toml. Please add it so mise install matches the hook requirements.
| set -e | ||
|
|
||
| # preflight: check required tools | ||
| for tool in swag jq yq api-spec-converter openapi; do |
There was a problem hiding this comment.
Partially fixed. Preflight is in place, but it now checks openapi and mise.toml still does not include it.
| dryRun := len(os.Args) > 1 && os.Args[1] == "--dry-run" | ||
|
|
||
| dtoDir := "./api/models" | ||
| if len(os.Args) > 2 { |
There was a problem hiding this comment.
Still open. Custom directory parsing still uses os.Args[2], so go run docs/annotate_dtos/main.go ./api/models does not work.
There was a problem hiding this comment.
It will never be used like that. We generate docs for the whole project, not per folder.
|
Also rebase from main. Thanks |
Summary
filter
Related