Skip to content

cannot directly serialize PhoneNumber #35

Description

@AartBluestoke

Because of the publicly visible member "defaultInstanceForType" which is self-referential.
If you are using newtonsoft for searialization this requires serializing everything with "Newtonsoft.Json.ReferenceLoopHandling.Ignore," (which could be dangerous, the default is to throw an exception by default for a good reason),

if you use the new c# language serializer, it will just crash with recursion limit exceeded.

Could the defaultInstanceForType please be annotated with 'don't serialize this', as it isn't part of the object state.

https://dotnetfiddle.net/rJNvxd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions