forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use vendored go-swagger (go-gitea#8087)
* Use vendored go-swagger * vendor go-swagger * revert un wanteed change * remove un-needed GO111MODULE * Update Makefile Co-Authored-By: techknowlogick <[email protected]>
- Loading branch information
1 parent
2f71571
commit 6e7a8cf
Showing
917 changed files
with
168,181 additions
and
9,451 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,8 @@ TAGS ?= | |
|
||
TMPDIR := $(shell mktemp -d 2>/dev/null || mktemp -d -t 'gitea-temp') | ||
|
||
#To update swagger use: GO111MODULE=on go get -u github.com/go-swagger/go-swagger/cmd/[email protected] | ||
SWAGGER := GO111MODULE=on $(GO) run -mod=vendor github.com/go-swagger/go-swagger/cmd/swagger | ||
SWAGGER_SPEC := templates/swagger/v1_json.tmpl | ||
SWAGGER_SPEC_S_TMPL := s|"basePath": *"/api/v1"|"basePath": "{{AppSubUrl}}/api/v1"|g | ||
SWAGGER_SPEC_S_JSON := s|"basePath": *"{{AppSubUrl}}/api/v1"|"basePath": "/api/v1"|g | ||
|
@@ -101,10 +103,7 @@ generate: | |
|
||
.PHONY: generate-swagger | ||
generate-swagger: | ||
@hash swagger > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ | ||
GO111MODULE="on" $(GO) get -u github.com/go-swagger/go-swagger/cmd/[email protected]; \ | ||
fi | ||
swagger generate spec -o './$(SWAGGER_SPEC)' | ||
$(SWAGGER) generate spec -o './$(SWAGGER_SPEC)' | ||
$(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)' | ||
$(SED_INPLACE) $(SWAGGER_NEWLINE_COMMAND) './$(SWAGGER_SPEC)' | ||
|
||
|
@@ -119,11 +118,8 @@ swagger-check: generate-swagger | |
|
||
.PHONY: swagger-validate | ||
swagger-validate: | ||
@hash swagger > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ | ||
$(GO) get -u github.com/go-swagger/go-swagger/cmd/swagger; \ | ||
fi | ||
$(SED_INPLACE) '$(SWAGGER_SPEC_S_JSON)' './$(SWAGGER_SPEC)' | ||
swagger validate './$(SWAGGER_SPEC)' | ||
$(SWAGGER) validate './$(SWAGGER_SPEC)' | ||
$(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)' | ||
|
||
.PHONY: errcheck | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.