Open sturlath opened 5 years ago
👍 Thanks for opening this issue! 🏷 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
@sturlath thanks for reporting the issue.
I added nullable support to csharp
before. Can you give it a try to see if it works for you? if it does, we can port the enhancement to the aspnetcore generator.
Ahhh in this one https://github.com/OpenAPITools/openapi-generator/pull/1819 @wing328? I totally missed it. Thought I had the newest one. I'll try out v4.0.0-beta2 release tonight and let you know if it worked.
Yup but I was incorrectly saying the csharp
generator had the enhancement. It should be thecsharp-netcore
with better nullable support.
There's also a PR to further improve the csharp-netcore
: https://github.com/OpenAPITools/openapi-generator/pull/2187. Please check it out if you've any feedback.
Description
If I try to generate aspnetcore dto's the nullable = false is alwasy ignored and all the properties created are created nullable.
If I have nullable field in my api.yaml file (skipping allot for brevity)
and then run the following
java -DdebugModels -jar openapi-generator-cli-4.0.0-20181226.105224-120.jar generate -i api.yaml -g aspnetcore -o c:\Temp -t templates\aspnetcore\controller -Dapis
I get
I can't seem to get rid off the ? (nullable) after the DateTime. I don't want it to be nullable!
openapi-generator version
4.0.0-20181226.105224-120
Command line used for generation
java -DdebugModels -jar openapi-generator-cli-4.0.0-20181226.105224-120.jar generate -i api.yaml -g aspnetcore -o c:\Temp -t templates\aspnetcore\dtos -Dapis
Steps to reproduce
Run the previous command line on a yaml file with property you want to have as non-nullable and see if you can make it so.
Related issues/PRs
Couldn't find anything except maybe this one