Open chrisburkh opened 2 months ago
For version 3.0 it should be okk, as I see in the template it has this code for the properties. (In versions 2.0 and 2.1 this is indeed the case). I am debugging it further to see where the problem lies, as i also get the same problem when doing so.
public {{{dataType}}}{{#nullableReferenceTypes}}{{^isContainer}}{{^required}}{{^isNullable}}?{{/isNullable}}{{/required}}{{/isContainer}}{{/nullableReferenceTypes}} {{name}} { get; set; }{{#defaultValue}} = {{{.}}};{{/defaultValue}}
The file of interest is aspnetcore-3.0-model.mustache
As indicated above for container objects there cannot be a nullable reference. If this is not a desired behaviour i can submit a PR with the fix. Changing the {{^isContainer}} to {{#isContainer}} and the {{^isNullable}} to {{/isNullable}} does the trick if you need a quick fix.
Bug Report Checklist
openapi-generator version
7.8.0
Description
When an array is makred as nullable in the openapi spec the generated property is NOT nullable
Generated Code:
expected outcome:
Generation Details