Skip to content

Deserialising null to JsonNode in nested structures fails in System.Text.Json #85172

Closed
@adj123

Description

@adj123

JsonSerializer.Deserialize<JsonNode>("null") returns null
JsonSerializer.Deserialize<List<JsonNode>>("[null]") throws
JsonSerializer.Deserialize<Dictionary<string, JsonNode>>("{ \"Foo\": null }") throws

Assuming this isn't intentional? Reproducible in .Net 6 & 7.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions