forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
686 changed files
with
143,379 additions
and
17 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 \ | ||
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 | ||
|
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
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 |
---|---|---|
@@ -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.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.