mirror of
https://github.com/Smaug123/WoofWare.Myriad
synced 2025-10-08 05:28:39 +00:00
Compare commits
1 Commits
WoofWare.M
...
WoofWare.M
Author | SHA1 | Date | |
---|---|---|---|
|
7930039ad1 |
@@ -11,10 +11,6 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="myriad.toml"/>
|
<None Include="myriad.toml"/>
|
||||||
<Compile Include="JsonParseNullness.fs" />
|
|
||||||
<Compile Include="GeneratedJsonParseNullness.fs">
|
|
||||||
<MyriadFile>JsonParseNullness.fs</MyriadFile>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="AssemblyInfo.fs" />
|
<Compile Include="AssemblyInfo.fs" />
|
||||||
<Compile Include="RecordFile.fs"/>
|
<Compile Include="RecordFile.fs"/>
|
||||||
<Compile Include="GeneratedRecord.fs">
|
<Compile Include="GeneratedRecord.fs">
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -71,7 +71,6 @@ module JsonRecordType =
|
|||||||
)
|
)
|
||||||
| v -> v)
|
| v -> v)
|
||||||
.AsArray ()
|
.AsArray ()
|
||||||
|> Seq.cast<System.Text.Json.Nodes.JsonNode>
|
|
||||||
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.Int32> ())
|
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.Int32> ())
|
||||||
|> Array.ofSeq
|
|> Array.ofSeq
|
||||||
|
|
||||||
@@ -85,7 +84,6 @@ module JsonRecordType =
|
|||||||
)
|
)
|
||||||
| v -> v)
|
| v -> v)
|
||||||
.AsArray ()
|
.AsArray ()
|
||||||
|> Seq.cast<System.Text.Json.Nodes.JsonNode>
|
|
||||||
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.String> ())
|
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.String> ())
|
||||||
|> Array.ofSeq
|
|> Array.ofSeq
|
||||||
|
|
||||||
@@ -111,7 +109,6 @@ module JsonRecordType =
|
|||||||
)
|
)
|
||||||
| v -> v)
|
| v -> v)
|
||||||
.AsArray ()
|
.AsArray ()
|
||||||
|> Seq.cast<System.Text.Json.Nodes.JsonNode>
|
|
||||||
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.Int32> ())
|
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.Int32> ())
|
||||||
|> List.ofSeq
|
|> List.ofSeq
|
||||||
|
|
||||||
@@ -204,15 +201,7 @@ module ToGetExtensionMethodJsonParseExtension =
|
|||||||
|
|
||||||
/// Parse from a JSON node.
|
/// Parse from a JSON node.
|
||||||
static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : ToGetExtensionMethod =
|
static member jsonParse (node : System.Text.Json.Nodes.JsonNode) : ToGetExtensionMethod =
|
||||||
let arg_20 =
|
let arg_20 = System.Numerics.BigInteger.Parse (node.["whiskey"].ToJsonString ())
|
||||||
let v = node.["whiskey"]
|
|
||||||
|
|
||||||
System.Numerics.BigInteger.Parse (
|
|
||||||
(match v with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v)
|
|
||||||
.ToJsonString ()
|
|
||||||
)
|
|
||||||
|
|
||||||
let arg_19 =
|
let arg_19 =
|
||||||
(match node.["victor"] with
|
(match node.["victor"] with
|
||||||
|
@@ -1,53 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// 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
|
|
||||||
}
|
|
@@ -60,7 +60,6 @@ module GymOpeningHours =
|
|||||||
)
|
)
|
||||||
| v -> v)
|
| v -> v)
|
||||||
.AsArray ()
|
.AsArray ()
|
||||||
|> Seq.cast<System.Text.Json.Nodes.JsonNode>
|
|
||||||
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.String> ())
|
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.String> ())
|
||||||
|> List.ofSeq
|
|> List.ofSeq
|
||||||
|
|
||||||
@@ -1039,7 +1038,6 @@ module Sessions =
|
|||||||
)
|
)
|
||||||
| v -> v)
|
| v -> v)
|
||||||
.AsArray ()
|
.AsArray ()
|
||||||
|> Seq.cast<System.Text.Json.Nodes.JsonNode>
|
|
||||||
|> Seq.map (fun elt -> Visit.jsonParse elt)
|
|> Seq.map (fun elt -> Visit.jsonParse elt)
|
||||||
|> List.ofSeq
|
|> List.ofSeq
|
||||||
|
|
||||||
|
@@ -48,16 +48,7 @@ module PureGymApi =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
return jsonNode.AsArray () |> Seq.map (fun elt -> Gym.jsonParse elt) |> List.ofSeq
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return
|
|
||||||
jsonNode.AsArray ()
|
|
||||||
|> Seq.cast<System.Text.Json.Nodes.JsonNode>
|
|
||||||
|> Seq.map (fun elt -> Gym.jsonParse elt)
|
|
||||||
|> List.ofSeq
|
|
||||||
}
|
}
|
||||||
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
||||||
|
|
||||||
@@ -91,11 +82,6 @@ module PureGymApi =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return GymAttendance.jsonParse jsonNode
|
return GymAttendance.jsonParse jsonNode
|
||||||
}
|
}
|
||||||
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
||||||
@@ -130,11 +116,6 @@ module PureGymApi =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return GymAttendance.jsonParse jsonNode
|
return GymAttendance.jsonParse jsonNode
|
||||||
}
|
}
|
||||||
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
||||||
@@ -165,11 +146,6 @@ module PureGymApi =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return Member.jsonParse jsonNode
|
return Member.jsonParse jsonNode
|
||||||
}
|
}
|
||||||
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
||||||
@@ -203,11 +179,6 @@ module PureGymApi =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return Gym.jsonParse jsonNode
|
return Gym.jsonParse jsonNode
|
||||||
}
|
}
|
||||||
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
||||||
@@ -238,11 +209,6 @@ module PureGymApi =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return MemberActivityDto.jsonParse jsonNode
|
return MemberActivityDto.jsonParse jsonNode
|
||||||
}
|
}
|
||||||
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
||||||
@@ -273,11 +239,6 @@ module PureGymApi =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return UriThing.jsonParse jsonNode
|
return UriThing.jsonParse jsonNode
|
||||||
}
|
}
|
||||||
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
||||||
@@ -333,11 +294,6 @@ module PureGymApi =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return
|
return
|
||||||
match jsonNode with
|
match jsonNode with
|
||||||
| null -> None
|
| null -> None
|
||||||
@@ -390,11 +346,6 @@ module PureGymApi =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return Sessions.jsonParse jsonNode
|
return Sessions.jsonParse jsonNode
|
||||||
}
|
}
|
||||||
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
||||||
@@ -436,11 +387,6 @@ module PureGymApi =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return Sessions.jsonParse jsonNode
|
return Sessions.jsonParse jsonNode
|
||||||
}
|
}
|
||||||
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
||||||
@@ -932,11 +878,6 @@ module PureGymApi =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return
|
return
|
||||||
new RestEase.Response<_> (
|
new RestEase.Response<_> (
|
||||||
responseString,
|
responseString,
|
||||||
@@ -973,11 +914,6 @@ module PureGymApi =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return
|
return
|
||||||
new RestEase.Response<_> (
|
new RestEase.Response<_> (
|
||||||
responseString,
|
responseString,
|
||||||
@@ -1014,11 +950,6 @@ module PureGymApi =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return
|
return
|
||||||
new RestEase.Response<_> (
|
new RestEase.Response<_> (
|
||||||
responseString,
|
responseString,
|
||||||
@@ -1055,11 +986,6 @@ module PureGymApi =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return
|
return
|
||||||
new RestEase.Response<_> (
|
new RestEase.Response<_> (
|
||||||
responseString,
|
responseString,
|
||||||
|
@@ -408,7 +408,6 @@ module InnerTypeWithBothJsonParseExtension =
|
|||||||
|
|
||||||
let value =
|
let value =
|
||||||
(kvp.Value).AsArray ()
|
(kvp.Value).AsArray ()
|
||||||
|> Seq.cast<System.Text.Json.Nodes.JsonNode>
|
|
||||||
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.Char> ())
|
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.Char> ())
|
||||||
|> List.ofSeq
|
|> List.ofSeq
|
||||||
|
|
||||||
@@ -677,7 +676,6 @@ module JsonRecordTypeWithBothJsonParseExtension =
|
|||||||
)
|
)
|
||||||
| v -> v)
|
| v -> v)
|
||||||
.AsArray ()
|
.AsArray ()
|
||||||
|> Seq.cast<System.Text.Json.Nodes.JsonNode>
|
|
||||||
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.Int32> ())
|
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.Int32> ())
|
||||||
|> Array.ofSeq
|
|> Array.ofSeq
|
||||||
|
|
||||||
@@ -691,7 +689,6 @@ module JsonRecordTypeWithBothJsonParseExtension =
|
|||||||
)
|
)
|
||||||
| v -> v)
|
| v -> v)
|
||||||
.AsArray ()
|
.AsArray ()
|
||||||
|> Seq.cast<System.Text.Json.Nodes.JsonNode>
|
|
||||||
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.String> ())
|
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.String> ())
|
||||||
|> Array.ofSeq
|
|> Array.ofSeq
|
||||||
|
|
||||||
@@ -717,7 +714,6 @@ module JsonRecordTypeWithBothJsonParseExtension =
|
|||||||
)
|
)
|
||||||
| v -> v)
|
| v -> v)
|
||||||
.AsArray ()
|
.AsArray ()
|
||||||
|> Seq.cast<System.Text.Json.Nodes.JsonNode>
|
|
||||||
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.Int32> ())
|
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.Int32> ())
|
||||||
|> List.ofSeq
|
|> List.ofSeq
|
||||||
|
|
||||||
|
@@ -94,7 +94,6 @@ module JwtVaultAuthResponse =
|
|||||||
)
|
)
|
||||||
| v -> v)
|
| v -> v)
|
||||||
.AsArray ()
|
.AsArray ()
|
||||||
|> Seq.cast<System.Text.Json.Nodes.JsonNode>
|
|
||||||
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.String> ())
|
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.String> ())
|
||||||
|> List.ofSeq
|
|> List.ofSeq
|
||||||
|
|
||||||
@@ -108,7 +107,6 @@ module JwtVaultAuthResponse =
|
|||||||
)
|
)
|
||||||
| v -> v)
|
| v -> v)
|
||||||
.AsArray ()
|
.AsArray ()
|
||||||
|> Seq.cast<System.Text.Json.Nodes.JsonNode>
|
|
||||||
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.String> ())
|
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.String> ())
|
||||||
|> List.ofSeq
|
|> List.ofSeq
|
||||||
|
|
||||||
@@ -122,7 +120,6 @@ module JwtVaultAuthResponse =
|
|||||||
)
|
)
|
||||||
| v -> v)
|
| v -> v)
|
||||||
.AsArray ()
|
.AsArray ()
|
||||||
|> Seq.cast<System.Text.Json.Nodes.JsonNode>
|
|
||||||
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.String> ())
|
|> Seq.map (fun elt -> elt.AsValue().GetValue<System.String> ())
|
||||||
|> List.ofSeq
|
|> List.ofSeq
|
||||||
|
|
||||||
@@ -499,11 +496,6 @@ module VaultClient =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return JwtSecretResponse.jsonParse jsonNode
|
return JwtSecretResponse.jsonParse jsonNode
|
||||||
}
|
}
|
||||||
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
||||||
@@ -540,11 +532,6 @@ module VaultClient =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return JwtVaultResponse.jsonParse jsonNode
|
return JwtVaultResponse.jsonParse jsonNode
|
||||||
}
|
}
|
||||||
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
||||||
@@ -603,11 +590,6 @@ module VaultClientNonExtensionMethod =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return JwtSecretResponse.jsonParse jsonNode
|
return JwtSecretResponse.jsonParse jsonNode
|
||||||
}
|
}
|
||||||
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
||||||
@@ -644,11 +626,6 @@ module VaultClientNonExtensionMethod =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return JwtVaultResponse.jsonParse jsonNode
|
return JwtVaultResponse.jsonParse jsonNode
|
||||||
}
|
}
|
||||||
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
||||||
@@ -710,11 +687,6 @@ module VaultClientExtensionMethodHttpClientExtension =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return JwtSecretResponse.jsonParse jsonNode
|
return JwtSecretResponse.jsonParse jsonNode
|
||||||
}
|
}
|
||||||
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
||||||
@@ -751,11 +723,6 @@ module VaultClientExtensionMethodHttpClientExtension =
|
|||||||
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
System.Text.Json.Nodes.JsonNode.ParseAsync (responseStream, cancellationToken = ct)
|
||||||
|> Async.AwaitTask
|
|> Async.AwaitTask
|
||||||
|
|
||||||
let jsonNode =
|
|
||||||
match jsonNode with
|
|
||||||
| null -> raise (System.ArgumentNullException ())
|
|
||||||
| v -> v
|
|
||||||
|
|
||||||
return JwtVaultResponse.jsonParse jsonNode
|
return JwtVaultResponse.jsonParse jsonNode
|
||||||
}
|
}
|
||||||
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
|> (fun a -> Async.StartAsTask (a, ?cancellationToken = ct))
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
namespace ConsumePlugin
|
|
||||||
|
|
||||||
[<WoofWare.Myriad.Plugins.JsonParse>]
|
|
||||||
type InnerStruct =
|
|
||||||
{
|
|
||||||
A : int
|
|
||||||
}
|
|
||||||
|
|
||||||
[<WoofWare.Myriad.Plugins.JsonParse>]
|
|
||||||
type ArrayOfInnerStruct =
|
|
||||||
{
|
|
||||||
B : InnerStruct array
|
|
||||||
}
|
|
@@ -1,23 +0,0 @@
|
|||||||
namespace WoofWare.Myriad.Plugins.Test
|
|
||||||
|
|
||||||
open System.Text.Json.Nodes
|
|
||||||
open FsUnitTyped
|
|
||||||
open NUnit.Framework
|
|
||||||
open ConsumePlugin
|
|
||||||
|
|
||||||
[<TestFixture>]
|
|
||||||
module TestJsonNullability =
|
|
||||||
|
|
||||||
[<Test>]
|
|
||||||
let ``Can consume JsonParseNullness`` () =
|
|
||||||
let options = JsonNodeOptions (PropertyNameCaseInsensitive = true)
|
|
||||||
|
|
||||||
"""{
|
|
||||||
"b": null
|
|
||||||
}"""
|
|
||||||
|> fun s -> JsonNode.Parse (s, options)
|
|
||||||
|> ArrayOfInnerStruct.jsonParse
|
|
||||||
|> shouldEqual
|
|
||||||
{
|
|
||||||
B = null
|
|
||||||
}
|
|
@@ -18,7 +18,6 @@
|
|||||||
<Compile Include="TestJsonParse\TestJsonParse.fs" />
|
<Compile Include="TestJsonParse\TestJsonParse.fs" />
|
||||||
<Compile Include="TestJsonParse\TestPureGymJson.fs" />
|
<Compile Include="TestJsonParse\TestPureGymJson.fs" />
|
||||||
<Compile Include="TestJsonParse\TestExtensionMethod.fs" />
|
<Compile Include="TestJsonParse\TestExtensionMethod.fs" />
|
||||||
<Compile Include="TestJsonParse\TestJsonNullability.fs" />
|
|
||||||
<Compile Include="TestHttpClient\TestPureGymRestApi.fs" />
|
<Compile Include="TestHttpClient\TestPureGymRestApi.fs" />
|
||||||
<Compile Include="TestHttpClient\TestPathParam.fs" />
|
<Compile Include="TestHttpClient\TestPathParam.fs" />
|
||||||
<Compile Include="TestHttpClient\TestReturnTypes.fs" />
|
<Compile Include="TestHttpClient\TestReturnTypes.fs" />
|
||||||
|
@@ -356,19 +356,3 @@ module internal AstHelper =
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
| _ -> failwithf "Failed to get record elements for type that was: %+A" repr
|
| _ -> failwithf "Failed to get record elements for type that was: %+A" repr
|
||||||
|
|
||||||
let raiseIfNull (variable : Ident) : SynExpr =
|
|
||||||
SynExpr.createMatch
|
|
||||||
(SynExpr.createIdent' variable)
|
|
||||||
[
|
|
||||||
SynMatchClause.create
|
|
||||||
SynPat.createNull
|
|
||||||
(SynExpr.applyFunction
|
|
||||||
(SynExpr.createIdent "raise")
|
|
||||||
(SynExpr.paren (
|
|
||||||
SynExpr.applyFunction
|
|
||||||
(SynExpr.createLongIdent [ "System" ; "ArgumentNullException" ])
|
|
||||||
(SynExpr.CreateConst ())
|
|
||||||
)))
|
|
||||||
SynMatchClause.create (SynPat.named "v") (SynExpr.createIdent "v")
|
|
||||||
]
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
namespace WoofWare.Myriad.Plugins
|
namespace WoofWare.Myriad.Plugins
|
||||||
|
|
||||||
|
open System.IO
|
||||||
open System.Net.Http
|
open System.Net.Http
|
||||||
open Fantomas.FCS.Syntax
|
open Fantomas.FCS.Syntax
|
||||||
open WoofWare.Whippet.Fantomas
|
open WoofWare.Whippet.Fantomas
|
||||||
@@ -13,6 +14,17 @@ type internal HttpClientGeneratorOutputSpec =
|
|||||||
module internal HttpClientGenerator =
|
module internal HttpClientGenerator =
|
||||||
open Fantomas.FCS.Text.Range
|
open Fantomas.FCS.Text.Range
|
||||||
|
|
||||||
|
let outputFile = FileInfo "/tmp/output.txt"
|
||||||
|
|
||||||
|
// do
|
||||||
|
// use _ = File.Create outputFile.FullName
|
||||||
|
// ()
|
||||||
|
|
||||||
|
let log (line : string) =
|
||||||
|
// use w = outputFile.AppendText ()
|
||||||
|
// w.WriteLine line
|
||||||
|
()
|
||||||
|
|
||||||
[<RequireQualifiedAccess>]
|
[<RequireQualifiedAccess>]
|
||||||
type PathSpec =
|
type PathSpec =
|
||||||
| Verbatim of string
|
| Verbatim of string
|
||||||
@@ -556,9 +568,6 @@ module internal HttpClientGenerator =
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
let jsonNodeNotNull =
|
|
||||||
Let ("jsonNode", AstHelper.raiseIfNull (Ident.create "jsonNode"))
|
|
||||||
|
|
||||||
let setVariableHeaders =
|
let setVariableHeaders =
|
||||||
variableHeaders
|
variableHeaders
|
||||||
|> List.map (fun (headerName, callToGetValue) ->
|
|> List.map (fun (headerName, callToGetValue) ->
|
||||||
@@ -633,7 +642,6 @@ module internal HttpClientGenerator =
|
|||||||
yield responseString
|
yield responseString
|
||||||
yield responseStream
|
yield responseStream
|
||||||
yield jsonNode
|
yield jsonNode
|
||||||
yield jsonNodeNotNull
|
|
||||||
| String -> yield responseString
|
| String -> yield responseString
|
||||||
| Stream -> yield responseStream
|
| Stream -> yield responseStream
|
||||||
| UnitType ->
|
| UnitType ->
|
||||||
@@ -642,7 +650,6 @@ module internal HttpClientGenerator =
|
|||||||
| _ ->
|
| _ ->
|
||||||
yield responseStream
|
yield responseStream
|
||||||
yield jsonNode
|
yield jsonNode
|
||||||
yield jsonNodeNotNull
|
|
||||||
]
|
]
|
||||||
|> SynExpr.createCompExpr "async" returnExpr
|
|> SynExpr.createCompExpr "async" returnExpr
|
||||||
|> SynExpr.startAsTask cancellationTokenArg
|
|> SynExpr.startAsTask cancellationTokenArg
|
||||||
@@ -907,6 +914,10 @@ module internal HttpClientGenerator =
|
|||||||
"Create a REST client. The input functions will be re-evaluated on every HTTP request to obtain the required values for the corresponding header properties."
|
"Create a REST client. The input functions will be re-evaluated on every HTTP request to obtain the required values for the corresponding header properties."
|
||||||
|> PreXmlDoc.create
|
|> PreXmlDoc.create
|
||||||
|
|
||||||
|
let functionName = Ident.create "client"
|
||||||
|
|
||||||
|
let pattern = SynLongIdent.createS "make"
|
||||||
|
|
||||||
let returnInfo = SynType.createLongIdent interfaceType.Name
|
let returnInfo = SynType.createLongIdent interfaceType.Name
|
||||||
|
|
||||||
let nameWithoutLeadingI =
|
let nameWithoutLeadingI =
|
||||||
|
@@ -78,7 +78,6 @@ module internal JsonParseGenerator =
|
|||||||
/// collectionType is e.g. "List"; we'll be calling `ofSeq` on it.
|
/// collectionType is e.g. "List"; we'll be calling `ofSeq` on it.
|
||||||
/// body is the body of a lambda which takes a parameter `elt`.
|
/// body is the body of a lambda which takes a parameter `elt`.
|
||||||
/// {assertNotNull node}.AsArray()
|
/// {assertNotNull node}.AsArray()
|
||||||
/// |> Seq.cast<JsonNode>
|
|
||||||
/// |> Seq.map (fun elt -> {body})
|
/// |> Seq.map (fun elt -> {body})
|
||||||
/// |> {collectionType}.ofSeq
|
/// |> {collectionType}.ofSeq
|
||||||
let asArrayMapped
|
let asArrayMapped
|
||||||
@@ -92,13 +91,6 @@ module internal JsonParseGenerator =
|
|||||||
| None -> node
|
| None -> node
|
||||||
| Some propertyName -> assertNotNull propertyName node
|
| Some propertyName -> assertNotNull propertyName node
|
||||||
|> SynExpr.callMethod "AsArray"
|
|> SynExpr.callMethod "AsArray"
|
||||||
|> SynExpr.pipeThroughFunction (
|
|
||||||
SynExpr.createLongIdent [ "Seq" ; "cast" ]
|
|
||||||
|> SynExpr.typeApp
|
|
||||||
[
|
|
||||||
SynType.createLongIdent' [ "System" ; "Text" ; "Json" ; "Nodes" ; "JsonNode" ]
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|> SynExpr.pipeThroughFunction (
|
|> SynExpr.pipeThroughFunction (
|
||||||
SynExpr.applyFunction (SynExpr.createLongIdent [ "Seq" ; "map" ]) (SynExpr.createLambda "elt" body)
|
SynExpr.applyFunction (SynExpr.createLongIdent [ "Seq" ; "map" ]) (SynExpr.createLambda "elt" body)
|
||||||
)
|
)
|
||||||
@@ -281,12 +273,10 @@ module internal JsonParseGenerator =
|
|||||||
)
|
)
|
||||||
|> SynExpr.pipeThroughFunction (SynExpr.createLongIdent [ "Map" ; "ofSeq" ])
|
|> SynExpr.pipeThroughFunction (SynExpr.createLongIdent [ "Map" ; "ofSeq" ])
|
||||||
| BigInt ->
|
| BigInt ->
|
||||||
AstHelper.raiseIfNull (Ident.create "v")
|
node
|
||||||
|> SynExpr.paren
|
|
||||||
|> SynExpr.callMethod "ToJsonString"
|
|> SynExpr.callMethod "ToJsonString"
|
||||||
|> SynExpr.paren
|
|> SynExpr.paren
|
||||||
|> SynExpr.applyFunction (SynExpr.createLongIdent [ "System" ; "Numerics" ; "BigInteger" ; "Parse" ])
|
|> SynExpr.applyFunction (SynExpr.createLongIdent [ "System" ; "Numerics" ; "BigInteger" ; "Parse" ])
|
||||||
|> SynExpr.createLet [ SynBinding.basic [ Ident.create "v" ] [] node ]
|
|
||||||
| Measure (_measure, primType) ->
|
| Measure (_measure, primType) ->
|
||||||
parseNumberType options propertyName node primType
|
parseNumberType options propertyName node primType
|
||||||
|> SynExpr.pipeThroughFunction (Measure.getLanguagePrimitivesMeasure primType)
|
|> SynExpr.pipeThroughFunction (Measure.getLanguagePrimitivesMeasure primType)
|
||||||
|
Reference in New Issue
Block a user