Tarmil / FSharp.SystemTextJson

System.Text.Json extensions for F# types
MIT License
329 stars 45 forks source link

Option to use lowercase in union case tag name #41

Closed drhumlen closed 4 years ago

drhumlen commented 4 years ago

Would be nice if:

type Color = Red | Blue | Green
serialize {| color = Red |}

Would serialize as {"color": "red"} instead of {"color": "Red"}.

Tarmil commented 4 years ago

This should work:

JsonFSharpConverter(unionTagNamingPolicy = JsonNamingPolicy.CamelCase)

I need to update the docs 😄