You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
generatorName: csharp-netcore
library: generichost
additionalProperties:
artifactId: PublicClient
packageName: PublicClient
targetFramework: net6.0
useDateTimeOffset: true
nullableReferenceTypes: true
packageDescription: Public client to access rest api
packageTitle: "Api Public Client"
Steps to reproduce
Run generate command on the provided swagger file.
Suggest a fix
Handle deserialization of date to datetime or directly handle generation of dateonly.
The text was updated successfully, but these errors were encountered:
Thanks for looking into this. I saw your pull request and tested the openapi-generator-cli-6.4.0-20230206.024543-10.jar where I think your fix should be.
It is not working as there is still an issue with deserialization. The server send the format expected by the API : yyyy-MM-dd but the DateTimeJsonConverter does not handle this format.
See list of supported format by the DateTimeJsonConverter
Description
When a model contains a
DateOnly
and serialize todate
(https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.0.md#data-types) the generated model contains a datetime and the DateTimeJsonConverter does not handle a date format. The deserialization throw a NotSupportedException.I would suggest to serialize also as
date
. But it's up to the server converter to handledatetime
asdate
.openapi-generator version
6.3.0-20230125.125049-89
csharp-netcore
OpenAPI declaration file content or url
https://gist.github.com/kYann/23eab426be79fd2cb93c2ddb902a8ecd
Generation Details
`java -jar ..\openapi-generator-cli-6.3.0-20230125.125049-89.jar generate -i ..\swagger.json -c ..\config.yaml``
config
generatorName: csharp-netcore
library: generichost
additionalProperties:
artifactId: PublicClient
packageName: PublicClient
targetFramework: net6.0
useDateTimeOffset: true
nullableReferenceTypes: true
packageDescription: Public client to access rest api
packageTitle: "Api Public Client"
Steps to reproduce
Run generate command on the provided swagger file.
Suggest a fix
Handle deserialization of date to datetime or directly handle generation of dateonly.
The text was updated successfully, but these errors were encountered: