Browse Source

Handle unmarshalling to json.Value

jakubtomsu 2 years ago
parent
commit
994825671d
1 changed files with 6 additions and 0 deletions
  1. 6 0
      core/encoding/json/unmarshal.odin

+ 6 - 0
core/encoding/json/unmarshal.odin

@@ -215,6 +215,12 @@ unmarshal_value :: proc(p: ^Parser, v: any) -> (err: Unmarshal_Error) {
 		}
 	}
 	
+    switch dst in &v {
+    // Handle json.Value as an unknown type
+    case Value:
+        dst = parse_value(p) or_return
+        return
+    }
 	
 	#partial switch token.kind {
 	case .Null: