NetJSON 1.4.5 serializes DateTime.MinValue using a one-digit year instead of the ISO 8601 required four-digit year.
Example:
Input:
DateTime.MinValue
Current output:
"1-01-01T00:00:00.0Z"
Expected output:
"0001-01-01T00:00:00.0Z"
The generated JSON cannot be deserialized by System.Text.Json because "1-01-01T00:00:00.0Z" is not a valid ISO 8601 date representation.
Configuration:
new NetJSONSettings
{
DateFormat = NetJSONDateFormat.ISO,
TimeZoneFormat = NetJSONTimeZoneFormat.Utc
}
This appears to be an ISO formatting bug. Years less than 1000 should be zero-padded to four digits (e.g. 0001, 0099, 0999), as required by ISO 8601 and expected by other JSON serializers.
NetJSON 1.4.5 serializes DateTime.MinValue using a one-digit year instead of the ISO 8601 required four-digit year.
Example:
Input:
DateTime.MinValue
Current output:
"1-01-01T00:00:00.0Z"
Expected output:
"0001-01-01T00:00:00.0Z"
The generated JSON cannot be deserialized by System.Text.Json because "1-01-01T00:00:00.0Z" is not a valid ISO 8601 date representation.
Configuration:
new NetJSONSettings
{
DateFormat = NetJSONDateFormat.ISO,
TimeZoneFormat = NetJSONTimeZoneFormat.Utc
}
This appears to be an ISO formatting bug. Years less than 1000 should be zero-padded to four digits (e.g. 0001, 0099, 0999), as required by ISO 8601 and expected by other JSON serializers.