mirror of
https://github.com/Smaug123/WoofWare.Myriad
synced 2025-10-06 04:28:42 +00:00
54 lines
1.9 KiB
Forth
54 lines
1.9 KiB
Forth
//------------------------------------------------------------------------------
|
|
// This code was generated by myriad.
|
|
// Changes to this file will be lost when the code is regenerated.
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
namespace ConsumePlugin
|
|
|
|
/// Module containing JSON parsing methods for the InnerStruct type
|
|
[<RequireQualifiedAccess ; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
|
|
module InnerStruct =
|
|
/// Parse from a JSON node.
|
|
let jsonParse (node : System.Text.Json.Nodes.JsonNode) : InnerStruct =
|
|
let arg_0 =
|
|
(match node.["a"] with
|
|
| null ->
|
|
raise (
|
|
System.Collections.Generic.KeyNotFoundException (
|
|
sprintf "Required key '%s' not found on JSON object" ("a")
|
|
)
|
|
)
|
|
| v -> v)
|
|
.AsValue()
|
|
.GetValue<System.Int32> ()
|
|
|
|
{
|
|
A = arg_0
|
|
}
|
|
namespace ConsumePlugin
|
|
|
|
/// Module containing JSON parsing methods for the ArrayOfInnerStruct type
|
|
[<RequireQualifiedAccess ; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
|
|
module ArrayOfInnerStruct =
|
|
/// Parse from a JSON node.
|
|
let jsonParse (node : System.Text.Json.Nodes.JsonNode) : ArrayOfInnerStruct =
|
|
let arg_0 =
|
|
(match node.["b"] with
|
|
| null ->
|
|
raise (
|
|
System.Collections.Generic.KeyNotFoundException (
|
|
sprintf "Required key '%s' not found on JSON object" ("b")
|
|
)
|
|
)
|
|
| v -> v)
|
|
.AsArray ()
|
|
|> Seq.cast<System.Text.Json.Nodes.JsonNode>
|
|
|> Seq.map (fun elt -> InnerStruct.jsonParse elt)
|
|
|> Array.ofSeq
|
|
|
|
{
|
|
B = arg_0
|
|
}
|