-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I'm now happy with Fable's reflection, which allows me to do what pydantic does in the python world.
However I want to step further. I want to allow syntax sugars in the configuration, but get the same syntax tree.
type github_url= { url: string; [<Default("main")>] branch: string}
type myconfig =
{
[<AllowSingular>] author: string array
url : github_url
...
}
By using attributes, I want to control JSON deserialization, to parse into the same results for
{
"author" : ["fable"],
"url" : { "name": "xxx/xxx", "branch", "main" },
...
}
and
{
"author": "fable",
"url": "xxx/xxx"
}
Is the use of attributes possible in Fable?
Metadata
Metadata
Assignees
Labels
No labels