OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
22.02k stars 6.61k forks source link

CSharpNetCoreClientCodegen generate nullable TimeSpan #4951

Open jannikov opened 4 years ago

jannikov commented 4 years ago
Description

Hi guys. Is there possibility generate nullable TimeSpan from scheme. I have --type-mappings arg in command line. It it map type correctly but nullable description is not involved.

Thank you for your help!

openapi-generator version

4.22

OpenAPI declaration file content or url
 "startTime": {
            "type": "string",
            "format": "date-span"
          },
          "endTime": {
            "type": "string",
            "format": "date-span",
            "nullable": true
          }, ....
Command line used for generation

openapi-generator generate -g csharp-netcore -i http://localhost:22525/swagger/v1/swagger.json -o RestApiClients -c v1-config.json -DapiTests=false -DapiDocs=false -DmodelTests=false -DmodelDocs=false --type-mappings date-span=TimeSpan --package-name Rest.V1

Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
aswinfrancis91 commented 1 year ago

Even i am looking for a soluton here

sharifahmad2061 commented 3 weeks ago

Need an answer for this.