Skip to content

System.Text.Json serialisation should include all public fields in a struct by default #44007

@jessicah

Description

@jessicah

Description

Serializing a struct with the System.Text.Json serializer should serialize all public fields by default, and only exclude fields by default for classes.

Other information

I haven't tested out record types in C# 9, but would expect the behaviour there to be the same as serializing a struct.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions