mirror of
https://github.com/BishopFox/sj.git
synced 2026-11-07 10:26:01 -10:00
Modified convert command to enable saved output even when definition file is already v3
This commit is contained in:
1 parent
3b3fed2c99
commit
a9f907e2f1
2 files changed
+3
-2
No files matched your search
+2
-1
@@ -55,7 +55,8 @@ var convertCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
if strings.HasPrefix(doc3.OpenAPI, "3") {
|
||||
log.Fatal("Definition file is already version 3.")
|
||||
log.Warnln("Definition file is already version 3.")
|
||||
WriteConvertedDefinitionFile(bodyBytes)
|
||||
} else if strings.HasPrefix(doc.Swagger, "2") {
|
||||
newDoc, err := openapi2conv.ToV3(&doc)
|
||||
if err != nil {
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ $ sj convert -u https://petstore.swagger.io/v2/swagger.json -o openapi.json`,
|
||||
log.Error("Command not specified. See the --help flag for usage.")
|
||||
}
|
||||
},
|
||||
Version: "1.9.1",
|
||||
Version: "1.9.2",
|
||||
}
|
||||
|
||||
func Execute() {
|
||||
|
||||
Reference in new issue
Block a user