Skip to content

Allowing null fields example from the docs is not working #186

@paredes-intracen

Description

@paredes-intracen

I was doing some tests to integrate deserialization into my code base, and I've been looking into the scenario with unspecified fields in the JSON. Which led me to the docs here https://github.com/Tarmil/FSharp.SystemTextJson/blob/master/docs/Customizing.md#allowing-null-fields

But running the example from the docs throws the exception "System.Text.Json.JsonException: Missing field for record type Rectangle: bottomLeft", regardless if the WithAllowNullFields() is used or not.

I ran the example with a FSX script and the #r "nuget: FSharp.SystemTextJson" package reference syntax.

I also posted a question in StackOverflow with a sightly modified example (what I'm really after is to be able to deserialized unspecified JSON fields into an Option type), and thanks to that I found another person who also confirmed that the example is not working as-is.

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