aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2019-11-09 21:03:18 +1000
committerSteve Bennett <steveb@workware.net.au>2019-11-09 21:06:57 +1000
commit7bb4dffaa22b9d90982a561f464d54a7f20c2032 (patch)
tree2f94cb0d63f128ac99ebcf1c5948eed52b49157a
parentdd064e670daf910fa50e138ec0c36822405b60f5 (diff)
downloadjimtcl-7bb4dffaa22b9d90982a561f464d54a7f20c2032.zip
jimtcl-7bb4dffaa22b9d90982a561f464d54a7f20c2032.tar.gz
jimtcl-7bb4dffaa22b9d90982a561f464d54a7f20c2032.tar.bz2
json: Fix decode schema for list obj
Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r--jim-json.c3
-rw-r--r--tests/json.test3
2 files changed, 6 insertions, 0 deletions
diff --git a/jim-json.c b/jim-json.c
index c75ac74..0a47d4d 100644
--- a/jim-json.c
+++ b/jim-json.c
@@ -159,6 +159,9 @@ json_decode_dump_container(Jim_Interp *interp, struct json_state *state)
}
}
}
+ else {
+ container_type = JSON_MIXED;
+ }
}
}
json_decode_add_schema_type(interp, state, container_type);
diff --git a/tests/json.test b/tests/json.test
index 066cc0f..8dfa567 100644
--- a/tests/json.test
+++ b/tests/json.test
@@ -95,6 +95,9 @@ test json-2.8 {schema tests} {
lindex [json::decode -schema {[1, 2, true, false]}] 1
} {mixed num num bool bool}
+test json-2.9 {schema tests} {
+ lindex [json::decode -schema {[{a:1},{b:2}]}] 1
+} {mixed {obj a num} {obj b num}}
unset -nocomplain json