Map/dictionary support, and check for null when passing to ofJson (#68)

This commit is contained in:
Patrick Stevens
2024-01-25 19:56:44 +00:00
committed by GitHub
parent 268a2f6f52
commit 515ea306a2
9 changed files with 1069 additions and 17 deletions

View File

@@ -61,7 +61,17 @@ module JsonRecordType =
|> Seq.map (fun elt -> elt.AsValue().GetValue<string> ())
|> Array.ofSeq
let D = InnerType.jsonParse node.["d"]
let D =
InnerType.jsonParse (
match node.["d"] with
| null ->
raise (
System.Collections.Generic.KeyNotFoundException (
sprintf "Required key '%s' not found on JSON object" ("d")
)
)
| v -> v
)
let C =
(match node.["hi"] with