Closed pallavJha closed 5 years ago
The original intention of that function was to check if a text is complete JSON structure (map or array), as opposed to a primitive JSON value I guess the devil is in the details,
Would renaming IsCompleteJSON to IsStructuredJSON address your concern?
Yes, it would do. Now, the caller of the function must know the difference between structured and primitive JSON.
The function,
IsCompleteJSON
, returnsfalse
when the input is"abc"
. However, Go'sjson.Valid()
returnstrue
for the same.https://github.com/viant/toolbox/blob/5994d07d8d5cd079b2ac2ca2d0ca14f9ab6a268f/json.go#L13