Generate swagger json (#1402)
- Generate swagger.json into public/ - Add swagger-ui auto-installation - Add footer link to local swagger-ui - Add /swagger url for using app url. - Fix Swagger-UI version via git tag
This commit is contained in:
parent
bb5f694fc5
commit
3edb0c5894
42 changed files with 2361 additions and 66 deletions
11
Makefile
11
Makefile
|
@ -54,6 +54,9 @@ generate:
|
|||
@hash go-bindata > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
go get -u github.com/jteeuwen/go-bindata/...; \
|
||||
fi
|
||||
@hash swagger > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
go get -u github.com/go-swagger/go-swagger/cmd/swagger; \
|
||||
fi
|
||||
go generate $(PACKAGES)
|
||||
|
||||
.PHONY: errcheck
|
||||
|
@ -184,5 +187,13 @@ stylesheets: public/css/index.css
|
|||
public/css/index.css: $(STYLESHEETS)
|
||||
lessc $< $@
|
||||
|
||||
.PHONY: swagger-ui
|
||||
swagger-ui:
|
||||
rm -Rf public/assets/swagger-ui
|
||||
git clone --depth=10 -b v3.0.7 --single-branch https://github.com/swagger-api/swagger-ui.git /tmp/swagger-ui
|
||||
mv /tmp/swagger-ui/dist public/assets/swagger-ui
|
||||
rm -Rf /tmp/swagger-ui
|
||||
sed -i "s;http://petstore.swagger.io/v2/swagger.json;../../swagger.v1.json;g" public/assets/swagger-ui/index.html
|
||||
|
||||
.PHONY: assets
|
||||
assets: javascripts stylesheets
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue