mirror of
https://github.com/Smaug123/WoofWare.Myriad
synced 2025-10-13 16:08:40 +00:00
JSON serialization (#69)
This commit is contained in:
29
ConsumePlugin/SerializationAndDeserialization.fs
Normal file
29
ConsumePlugin/SerializationAndDeserialization.fs
Normal file
@@ -0,0 +1,29 @@
|
||||
namespace ConsumePlugin
|
||||
|
||||
open System
|
||||
open System.Collections.Generic
|
||||
open System.Text.Json.Serialization
|
||||
|
||||
[<WoofWare.Myriad.Plugins.JsonParse true>]
|
||||
[<WoofWare.Myriad.Plugins.JsonSerialize true>]
|
||||
type InnerTypeWithBoth =
|
||||
{
|
||||
[<JsonPropertyName("it's-a-me")>]
|
||||
Thing : string
|
||||
Map : Map<string, Uri>
|
||||
ReadOnlyDict : IReadOnlyDictionary<string, char list>
|
||||
Dict : IDictionary<Uri, bool>
|
||||
ConcreteDict : Dictionary<string, InnerTypeWithBoth>
|
||||
}
|
||||
|
||||
[<WoofWare.Myriad.Plugins.JsonParse true>]
|
||||
[<WoofWare.Myriad.Plugins.JsonSerialize true>]
|
||||
type JsonRecordTypeWithBoth =
|
||||
{
|
||||
A : int
|
||||
B : string
|
||||
C : int list
|
||||
D : InnerTypeWithBoth
|
||||
E : string array
|
||||
F : int[]
|
||||
}
|
Reference in New Issue
Block a user