You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bb-exp-util/src/main/kotlin/org/evomaster/json2yaml/Main.kt
+27-9Lines changed: 27 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -45,32 +45,42 @@ class Main {
45
45
jsonToYaml(args[1])
46
46
}
47
47
"updateURLAndPort"-> {
48
-
if (args.size !=4&& args.size !=3)
49
-
throwIllegalArgumentException("to update url and port, the args should be 3 or 4, ie., `updateURLAndPort <openapi path> <port> <openapi V2ToV3>`")
48
+
if (args.size >5|| args.size <3)
49
+
throwIllegalArgumentException("to update url and port, the args should be 3--5, ie., `updateURLAndPort <openapi path> <port> <openapi V2ToV3> <output format, json or yaml>`")
50
+
val format =if (args.size !=5) nullelse args[4]
50
51
try {
51
52
args[2].toInt()
52
-
if (args.size ==4)
53
+
if (args.size >=4)
53
54
args[3].toBoolean()
55
+
if (format !=null&&listOf("json","yaml").none { format.equals(it, ignoreCase =true) })
56
+
throwIllegalArgumentException("output format could be either json or yaml")
54
57
}catch (ex:NumberFormatException){
55
58
throwIllegalArgumentException("port must be a int number and <openapi V2ToV3> must be boolean")
0 commit comments