Bug Report Checklist
Description
There is an issue with deserializing DateOnly properties with generated DateOnlyJsonConverter deserialization fail with
System.NotSupportedException: Specified method is not supported.
at DateOnlyJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
openapi-generator version
7.16.0
OpenAPI declaration file content or url
Schema
Generation Details
Steps to reproduce
- Use schema above
- generate client
- Try to deserialize json
{"id":1,"created":"2025-10-07"}
Related issues/PRs
Suggest a fix
If you want to parse DateOnly type you cannot provide settings for Time with DateTimeStyles enum.
TryParse should be like this
if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateOnly result))
return result;
Bug Report Checklist
Description
There is an issue with deserializing DateOnly properties with generated DateOnlyJsonConverter deserialization fail with
System.NotSupportedException: Specified method is not supported.
at DateOnlyJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
openapi-generator version
7.16.0
OpenAPI declaration file content or url
Schema
Generation Details
Steps to reproduce
{"id":1,"created":"2025-10-07"}Related issues/PRs
Suggest a fix
If you want to parse DateOnly type you cannot provide settings for Time with DateTimeStyles enum.
TryParse should be like this
if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateOnly result))
return result;