Skip to content

Commit 2eda08a

Browse files
committed
feat: change swagger command
1 parent 85c243d commit 2eda08a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

cmd/sponge/commands/generate/template.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ func NewCenter(configFile string) (*Center, error) {
279279
280280
checkResult $?
281281
282-
sponge web swagger2-to-openapi3 --file=docs/apis.swagger.json > /dev/null 2>&1
283-
sponge web swagger --file=docs/apis.swagger.json > /dev/null 2>&1
282+
# handle apis.swagger.json
283+
sponge web swagger --enable-standardize-response --enable-to-openapi3 --enable-integer-to-string --file=docs/apis.swagger.json > /dev/null
284284
285285
moduleName=$(cat docs/gen.info | head -1 | cut -d , -f 1)
286286
serverName=$(cat docs/gen.info | head -1 | cut -d , -f 2)
@@ -308,8 +308,8 @@ func NewCenter(configFile string) (*Center, error) {
308308
309309
checkResult $?
310310
311-
sponge web swagger2-to-openapi3 --file=docs/apis.swagger.json > /dev/null 2>&1
312-
sponge web swagger --file=docs/apis.swagger.json > /dev/null 2>&1
311+
# handle apis.swagger.json
312+
sponge web swagger --enable-standardize-response --enable-to-openapi3 --enable-integer-to-string --file=docs/apis.swagger.json > /dev/null
313313
314314
moduleName=$(cat docs/gen.info | head -1 | cut -d , -f 1)
315315
serverName=$(cat docs/gen.info | head -1 | cut -d , -f 2)
@@ -337,8 +337,8 @@ func NewCenter(configFile string) (*Center, error) {
337337
338338
checkResult $?
339339
340-
sponge web swagger2-to-openapi3 --file=docs/apis.swagger.json > /dev/null 2>&1
341-
sponge web swagger --file=docs/apis.swagger.json > /dev/null 2>&1
340+
# handle apis.swagger.json
341+
sponge web swagger --enable-standardize-response --enable-to-openapi3 --enable-integer-to-string --file=docs/apis.swagger.json > /dev/null
342342
343343
moduleName=$(cat docs/gen.info | head -1 | cut -d , -f 1)
344344
serverName=$(cat docs/gen.info | head -1 | cut -d , -f 2)

scripts/protoc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ function generateBySpecifiedProto(){
201201
checkResult $?
202202

203203
# handle apis.swagger.json
204-
sponge web swagger --enable-standardize-response --enable-to-openapi3 --enable-integer-to-string --file=docs/apis.swagger.json > /dev/null 2>&1
204+
sponge web swagger --enable-standardize-response --enable-to-openapi3 --enable-integer-to-string --file=docs/apis.swagger.json > /dev/null
205205

206206
# A total of four files are generated: the registration route file *_router.pb.go (saved in the same directory as the protobuf file),
207207
# the injection route file *_router.go (saved in internal/routers by default), the logic code template file *.go (saved in internal/service by default),

scripts/swag-docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ checkResult $?
3030
sponge patch modify-dup-num --dir=internal/ecode
3131
sponge patch modify-dup-err-code --dir=internal/ecode
3232
# handle swagger.json
33-
sponge web swagger --enable-standardize-response --enable-to-openapi3 --enable-integer-to-string --file=docs/swagger.json > /dev/null 2>&1
33+
sponge web swagger --enable-to-openapi3 --enable-integer-to-string --file=docs/swagger.json > /dev/null
3434

3535
colorGreen='\033[1;32m'
3636
colorCyan='\033[1;36m'

0 commit comments

Comments
 (0)