Allow serde of guids (#82)

This commit is contained in:
Patrick Stevens
2024-02-06 18:50:26 +00:00
committed by GitHub
parent e453a6f07c
commit 1215834795
6 changed files with 42 additions and 5 deletions

View File

@@ -21,7 +21,7 @@ module InnerTypeWithBothJsonSerializeExtension =
let node = System.Text.Json.Nodes.JsonObject ()
do
node.Add (("it's-a-me"), System.Text.Json.Nodes.JsonValue.Create<string> input.Thing)
node.Add (("it's-a-me"), System.Text.Json.Nodes.JsonValue.Create<Guid> input.Thing)
node.Add (
"map",
@@ -245,6 +245,7 @@ module InnerTypeWithBothJsonParseExtension =
| v -> v)
.AsValue()
.GetValue<string> ()
|> System.Guid.Parse
{
Thing = Thing

View File

@@ -9,7 +9,7 @@ open System.Text.Json.Serialization
type InnerTypeWithBoth =
{
[<JsonPropertyName("it's-a-me")>]
Thing : string
Thing : Guid
Map : Map<string, Uri>
ReadOnlyDict : IReadOnlyDictionary<string, char list>
Dict : IDictionary<Uri, bool>