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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user