Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
enum System.​Text.​Json.​Serialization.​JsonNumberHandling
Assembly: System.Text.Json
Determines how <see cref="T:System.Text.Json.JsonSerializer" /> handles numbers when serializing and deserializing.
Values
Strict
Numbers will only be read from <see cref="F:System.Text.Json.JsonTokenType.Number" /> tokens and will only be written as JSON numbers (without quotes).
AllowReadingFromString
Numbers can be read from <see cref="F:System.Text.Json.JsonTokenType.String" /> tokens. Does not prevent numbers from being read from <see cref="F:System.Text.Json.JsonTokenType.Number" /> token.
WriteAsString
Numbers will be written as JSON strings (with quotes), not as JSON numbers.
AllowNamedFloatingPointLiterals
The "NaN", "Infinity", and "-Infinity" <see cref="F:System.Text.Json.JsonTokenType.String" /> tokens can be read as floating-point constants, and the <see cref="T:System.Single" /> and <see cref="T:System.Double" /> values for these constants will be written as their corresponding JSON string representations.