Add swagger check (#3811)
This commit is contained in:
parent
cf8c2e5951
commit
3506717e9c
13 changed files with 143 additions and 124 deletions
11
Makefile
11
Makefile
|
@ -91,6 +91,15 @@ generate-swagger:
|
|||
fi
|
||||
swagger generate spec -o ./public/swagger.v1.json
|
||||
|
||||
.PHONY: swagger-check
|
||||
swagger-check: generate-swagger
|
||||
@diff=$$(git diff public/swagger.v1.json); \
|
||||
if [ -n "$$diff" ]; then \
|
||||
echo "Please run 'make generate-swagger' and commit the result:"; \
|
||||
echo "$${diff}"; \
|
||||
exit 1; \
|
||||
fi;
|
||||
|
||||
.PHONY: errcheck
|
||||
errcheck:
|
||||
@hash errcheck > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
|
@ -288,7 +297,7 @@ generate-stylesheets:
|
|||
.PHONY: swagger-ui
|
||||
swagger-ui:
|
||||
rm -Rf public/vendor/assets/swagger-ui
|
||||
git clone --depth=10 -b v3.3.2 --single-branch https://github.com/swagger-api/swagger-ui.git $(TMPDIR)/swagger-ui
|
||||
git clone --depth=10 -b v3.13.4 --single-branch https://github.com/swagger-api/swagger-ui.git $(TMPDIR)/swagger-ui
|
||||
mv $(TMPDIR)/swagger-ui/dist public/vendor/assets/swagger-ui
|
||||
rm -Rf $(TMPDIR)/swagger-ui
|
||||
$(SED_INPLACE) "s;http://petstore.swagger.io/v2/swagger.json;../../../swagger.v1.json;g" public/vendor/assets/swagger-ui/index.html
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue