<PackageReference Include="System.Text.Json" Version="8.0.1" />

JsonNumberHandling

public enum JsonNumberHandling
Determines how JsonSerializer handles numbers when serializing and deserializing.

The "NaN", "Infinity", and "-Infinity" String tokens can be read as floating-point constants, and the Single and Double values for these constants will be written as their corresponding JSON string representations.

Numbers can be read from String tokens. Does not prevent numbers from being read from Number token.

Strict = 0

Numbers will only be read from Number tokens and will only be written as JSON numbers (without quotes).

Numbers will be written as JSON strings (with quotes), not as JSON numbers.