Skip to content

Commit

Permalink
Make string type coercion work for objects and arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmens committed Nov 4, 2019
2 parents c57567f + 0b0e354 commit 1ca2a07
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jo.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ JsonNode *vnode(char *str, int flags)
}

if (*str == '{' || *str == '[') {
if (type == JSON_STRING) {
return json_mkstring(str);
}
JsonNode *obj = json_decode(str);

if (obj == NULL) {
Expand Down

0 comments on commit 1ca2a07

Please sign in to comment.