Skip to content

ImmutableDynamicObj map not serialized correctly out of the box #5

Closed

Description

@kMutagene

There seems to be additional steps necessary to ensure that Newtonsoft.Json correctly serializes ImmutableDynamicObj. See this comparison:

DynamicObj (works)

let works =
    let foo = DynamicObj()
    foo?bar <- [1;2;3;4]
    foo

works |> JsonConvert.SerializeObject

val it : string = "{"bar":[1,2,3,4]}"

ImmutableDynamicObj (soes not work)

ImmutableDynamicObj()
|> ImmutableDynamicObj.add "foo" "bar" 
|> JsonConvert.SerializeObject

val it : string = "{}"

Activity

  1. added
    enhancement
    on Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions