You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seemed like that this is impossible to achieve with FSharp.Json for now.
Is it possible to have a [<Expand>] attribute to achieve such task?
I got this idea because I wanted to expand the result of serializing a DU with union case key / value mode, like so:
[<JsonUnion(Mode = UnionMode.CaseKeyAsFieldValue, CaseKeyField="casekey", CaseValueField="casevalue")>]typeDU=| Example ofstringtypeExRec={ Val:int; Union:DU }letdata={ Val =1; Union = DU.Example "str"}letjson= Json.serialize data
For example, I wanted to serialize the following records:
into such form:
It seemed like that this is impossible to achieve with
FSharp.Json
for now.Is it possible to have a
[<Expand>]
attribute to achieve such task?I got this idea because I wanted to expand the result of serializing a DU with union case key / value mode, like so:
into such form:
The text was updated successfully, but these errors were encountered: