FSharp.Data
FSharp.Data copied to clipboard
Is there a way to hide properties with null values for JsonProvider?
This piece of code:
open FSharp.Data
type ColorProvider = JsonProvider<"""
[
{
"color": "Red",
"code": 15
},
{
"color": "Green"
}
]
""", SampleIsList=true>
let value = ColorProvider.Root(color = "Blue", code = None)
printf "%A" value
Produces this JSON:
{
"color": "Blue",
"code": null
}
Can I somehow configure the provider to skip the code
property in this case?
Any thoughts on how to address this or work around it? This issues is causing my generated JSON to be rejected by the server I'm integrating with. Thanks!