aboutsummaryrefslogtreecommitdiff
path: root/core/encoding/json
diff options
context:
space:
mode:
Diffstat (limited to 'core/encoding/json')
-rw-r--r--core/encoding/json/marshal.odin2
-rw-r--r--core/encoding/json/unmarshal.odin2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/encoding/json/marshal.odin b/core/encoding/json/marshal.odin
index 04ef6d434..f45cdb1f1 100644
--- a/core/encoding/json/marshal.odin
+++ b/core/encoding/json/marshal.odin
@@ -420,7 +420,7 @@ marshal_to_writer :: proc(w: io.Writer, v: any, opt: ^Marshal_Options) -> (err:
data := rawptr(uintptr(v.data) + info.offsets[i])
the_value := any{data, id}
- if is_omitempty(the_value) {
+ if omitempty && is_omitempty(the_value) {
continue
}
diff --git a/core/encoding/json/unmarshal.odin b/core/encoding/json/unmarshal.odin
index 691303521..eb59e7838 100644
--- a/core/encoding/json/unmarshal.odin
+++ b/core/encoding/json/unmarshal.odin
@@ -348,7 +348,7 @@ json_name_from_tag_value :: proc(value: string) -> (json_name, extra: string) {
json_name = value
if comma_index := strings.index_byte(json_name, ','); comma_index >= 0 {
json_name = json_name[:comma_index]
- extra = json_name[comma_index:]
+ extra = value[1 + comma_index:]
}
return
}