-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Use vendored go-swagger #8087
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use vendored go-swagger #8087
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
|
@@ -100,11 +102,8 @@ generate: | |
GO111MODULE=on $(GO) generate -mod=vendor $(PACKAGES) | ||
|
||
.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)' | ||
generate-swagger: | ||
$(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 \ | ||
GO111MODULE="on" $(GO) get -u github.com/go-swagger/go-swagger/cmd/[email protected]; \ | ||
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 | ||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2019 The Gitea Authors. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
// +build tools | ||
|
||
package tools | ||
|
||
import ( | ||
_ "github.com/go-swagger/go-swagger/cmd/swagger" | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.