Skip to content

Commit ff9485a

Browse files
NerzaltzxdtcleosunmosdghchjTobias Theel
authored
V2: Update Makefile (#1560)
* Update README_zh-CN.md (#1545) remove repeat net/http * Add option to set template delimiters (#1499) * Add template action delimiter cli flag * Add delims to generator config and template Also adds tests using the "quote" test as a base. This has to have a custom Instance name or it will clash with the "quotes" one and panic since it will have registered two "swagger" instances in the package test. * Add testdata for custom delim flags Based on the "quote" testdata. * Add delims to the spec, with tests. Make sure we don't add delims if they are empty. This shouldn't be possible, but might as well be safe. * Go mod tidy and sum update * Make the CLI experience a bit cleaner * Revert go.mod and sum * Update readme * fix bug: enums of explicit type conversion (#1556) Signed-off-by: sdghchj <sdghchj@qq.com> * integrate new delimiter feature from master branch into v2 * cleanup * update makefile to use v2 path --------- Signed-off-by: sdghchj <sdghchj@qq.com> Co-authored-by: tzxdtc10 <tzxdtc10@gmail.com> Co-authored-by: Leo Palmer Sunmo <leosunmo@users.noreply.github.com> Co-authored-by: sdghchj <sdghchj@qq.com> Co-authored-by: Tobias Theel <tt@fino.digital>
1 parent 45df9a3 commit ff9485a

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ GOPATH:=$(shell $(GOCMD) env GOPATH)
1313
u := $(if $(update),-u)
1414

1515
BINARY_NAME:=swag
16-
PACKAGES:=$(shell $(GOLIST) github.com/swaggo/swag github.com/swaggo/swag/cmd/swag github.com/swaggo/swag/gen github.com/swaggo/swag/format)
16+
PACKAGES:=$(shell $(GOLIST) github.com/swaggo/swag/v2 github.com/swaggo/swag/v2/cmd/swag github.com/swaggo/swag/v2/gen github.com/swaggo/swag/v2/format)
1717
GOFILES:=$(shell find . -name "*.go" -type f)
1818

1919
export GO111MODULE := on

gen/src/oas2.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var SwaggerInfo{{ if ne .InstanceName "swagger" }}{{ .InstanceName }} {{- end }}
1717
InfoInstanceName: {{ printf "%q" .InstanceName }},
1818
SwaggerTemplate: docTemplate{{ if ne .InstanceName "swagger" }}{{ .InstanceName }} {{- end }},
1919
LeftDelim: {{ printf "%q" .LeftTemplateDelim}},
20-
RightDelim: {{ printf "%q" .RightTemplateDelim}},
20+
RightDelim: {{ printf "%q" .RightTemplateDelim}},
2121
}
2222

2323
func init() {

gen/src/oas3.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var SwaggerInfo{{ if ne .InstanceName "swagger" }}{{ .InstanceName }} {{- end }}
1414
InfoInstanceName: {{ printf "%q" .InstanceName }},
1515
SwaggerTemplate: docTemplate{{ if ne .InstanceName "swagger" }}{{ .InstanceName }} {{- end }},
1616
LeftDelim: {{ printf "%q" .LeftTemplateDelim}},
17-
RightDelim: {{ printf "%q" .RightTemplateDelim}},
17+
RightDelim: {{ printf "%q" .RightTemplateDelim}},
1818
}
1919

2020
func init() {

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/pkg/errors v0.9.1
1010
github.com/stretchr/testify v1.8.2
1111
github.com/sv-tools/openapi v0.2.1
12-
golang.org/x/tools v0.7.0
12+
golang.org/x/tools v0.8.0
1313
sigs.k8s.io/yaml v1.3.0
1414
)
1515

go.sum

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ github.com/urfave/cli/v2 v2.25.1 h1:zw8dSP7ghX0Gmm8vugrs6q9Ku0wzweqPyshy+syu9Gw=
6464
github.com/urfave/cli/v2 v2.25.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
6565
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
6666
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
67-
golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=
67+
golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
6868
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
6969
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
70-
golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4=
71-
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
70+
golang.org/x/tools v0.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y=
71+
golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
7272
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
7373
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
7474
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

0 commit comments

Comments
 (0)