API: Fix swagger generation (#50071)

* API: Fix Swagger generation using docker

* Unset SWAGGER_GENERATE_EXTENSION for Mac
This commit is contained in:
Sofia Papagiannaki 2022-06-03 13:31:14 +03:00 committed by GitHub
parent 573e121a67
commit a165b40e56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1974 additions and 4532 deletions

View File

@ -43,6 +43,7 @@ $(SPEC_TARGET): $(API_DEFINITION_FILES) ## Generate API spec
-e SWAGGER_GENERATE_EXTENSION=false \
-v ${HOME}/go:/go \
-v $$(pwd):/grafana \
-v $$(pwd)/../grafana-enterprise:$$(pwd)/../grafana-enterprise \
-w $$(pwd)/pkg/api/docs quay.io/goswagger/swagger:$(SWAGGER_TAG) \
generate spec -m -o /grafana/public/api-spec.json \
-w /grafana/pkg/server \
@ -62,7 +63,7 @@ ensure_go-swagger_mac:
@hash swagger &>/dev/null || (brew tap go-swagger/go-swagger && brew install go-swagger)
--swagger-api-spec-mac: ensure_go-swagger_mac $(API_DEFINITION_FILES) ## Generate API spec (for M1 Mac)
swagger generate spec -m -w pkg/server -o public/api-spec.json \
SWAGGER_GENERATE_EXTENSION=false swagger generate spec -m -w pkg/server -o public/api-spec.json \
-x "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" \
-x "github.com/prometheus/alertmanager" \
-i pkg/api/docs/tags.json

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff