From 76ba3fe06b8938871520c46356ab37fc076b7882 Mon Sep 17 00:00:00 2001 From: Gil Brandao Date: Wed, 9 Oct 2019 11:40:12 +0100 Subject: [PATCH] Make string type coercion work for objects and arrays --- jo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jo.c b/jo.c index 18cade7..118b4cb 100644 --- a/jo.c +++ b/jo.c @@ -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) {