HLWeil / JsonDSL

Small FSharp based DSL for writing literal json
MIT License
4 stars 1 forks source link

[BUG] Array CE does yield null for `Option.Some` #8

Open kMutagene opened 1 year ago

kMutagene commented 1 year ago

I think it would be ideal to just not yield anything when an expression in the array CE evaluates to None, e.g.

(object {
    property "an array" (array {
        Option.Some 4
        Option.None
        Option.Some 2
    })
}).ToJsonString(options)

leading to this json:

{
  "an array": [
    4,
    2
  ]
}

but we currently get this:

{
  "an array": [
    4,
    null,
    2
  ]
}