diff --git a/.drone.yml b/.drone.yml index cac0c38706..7a7b8762d0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -77,6 +77,7 @@ pipeline: - make vet - make lint - make fmt-check + - make swagger-check - make misspell-check - make test-vendor - make build diff --git a/Makefile b/Makefile index 4f4802a024..f79df2b4b3 100644 --- a/Makefile +++ b/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 diff --git a/public/swagger.v1.json b/public/swagger.v1.json index 5c3c21532f..dec618988b 100644 --- a/public/swagger.v1.json +++ b/public/swagger.v1.json @@ -4325,6 +4325,32 @@ } } }, + "/topics/search": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "search topics via keyword", + "operationId": "topicSearch", + "parameters": [ + { + "type": "integer", + "description": "id of the repo to get", + "name": "keyword", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/Repository" + } + } + } + }, "/user": { "get": { "produces": [ diff --git a/public/vendor/assets/swagger-ui/index.html b/public/vendor/assets/swagger-ui/index.html index 9bf4493bb3..2dd995028e 100644 --- a/public/vendor/assets/swagger-ui/index.html +++ b/public/vendor/assets/swagger-ui/index.html @@ -1,95 +1,61 @@ -
- -