mirror of
https://github.com/Smaug123/WoofWare.Myriad
synced 2025-10-11 15:08:40 +00:00
Add JSON parse source gen (#9)
This commit is contained in:
28
ConsumePlugin/JsonRecord.fs
Normal file
28
ConsumePlugin/JsonRecord.fs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace ConsumePlugin
|
||||
|
||||
open System.Text.Json.Serialization
|
||||
|
||||
module Literals =
|
||||
[<Literal>]
|
||||
let something = "something"
|
||||
|
||||
[<MyriadPlugin.JsonParse>]
|
||||
type InnerType =
|
||||
{
|
||||
[<JsonPropertyName(Literals.something)>]
|
||||
Thing : string
|
||||
}
|
||||
|
||||
/// My whatnot
|
||||
[<MyriadPlugin.JsonParse>]
|
||||
type JsonRecordType =
|
||||
{
|
||||
/// A thing!
|
||||
A : int
|
||||
/// Another thing!
|
||||
[<JsonPropertyName "another-thing">]
|
||||
B : string
|
||||
[<System.Text.Json.Serialization.JsonPropertyName "hi">]
|
||||
C : int list
|
||||
D : InnerType
|
||||
}
|
Reference in New Issue
Block a user