Alerting: Fix invalid swagger specification (#51907)

* Alerting: Fix invalid swagger specification

* Add make targets for validating the generated swagger spec
This commit is contained in:
Sofia Papagiannaki
2022-07-13 12:34:54 +03:00
committed by GitHub
parent b3992df988
commit 21632817c5
11 changed files with 720 additions and 145 deletions
+7 -1
View File
@@ -30,6 +30,12 @@ post.json: spec.json
api.json: spec-stable.json
go run cmd/clean-swagger/main.go -if $(<) -of $@
validate-stable: spec-stable.json $(SWAGGER)
$(SWAGGER) validate $(<)
validate: spec.json $(SWAGGER)
$(SWAGGER) validate $(<)
swagger-codegen-api:
docker run --rm -v $$(pwd):/local --user $$(id -u):$$(id -g) parsertongue/swagger-codegen-cli:3.0.32 generate \
-i /local/post.json \
@@ -59,4 +65,4 @@ serve: post.json
serve-stable: api.json
docker run --rm -p 80:8080 -v $$(pwd):/tmp -e SWAGGER_FILE=/tmp/$(<) swaggerapi/swagger-editor
all: post.json api.json swagger-codegen-api fix copy-files clean
all: post.json validate api.json validate-stable swagger-codegen-api fix copy-files clean