We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de8a96f commit 27e5e37Copy full SHA for 27e5e37
internal/cmd/params_validation.go
@@ -84,8 +84,9 @@ func isJSONParams(input string) bool {
84
if input == "" {
85
return false
86
}
87
- if !((strings.HasPrefix(input, "{") && strings.HasSuffix(input, "}")) ||
88
- (strings.HasPrefix(input, "[") && strings.HasSuffix(input, "]"))) {
+ isJSONObject := strings.HasPrefix(input, "{") && strings.HasSuffix(input, "}")
+ isJSONArray := strings.HasPrefix(input, "[") && strings.HasSuffix(input, "]")
89
+ if !isJSONObject && !isJSONArray {
90
91
92
return json.Valid([]byte(input))
0 commit comments