Open mobilekosmos opened 1 year ago
By default, all object properties are optional. You can specify the required properties in the required list
But the specification also has the nullable attribute for each data type, which is being ignored.
I understand now that a property which is not required must be handled as nullable on the client side, but maybe if this works as designed we could make a feature request out of this? We need to be able to configure this in the generator with a flag, I'm surprised I'm the first one to come up with this?
Bug Report Checklist
Description
When I use the open-api-generator all of the model fields are ? nullable, all classes look like this:
Despite those fields are not all nullable in the swagger.json.
openapi-generator version
6.3.0
OpenAPI declaration file content or url
swagger.json
Generation Details
Steps to reproduce
Run above batch file. Check all model classes. For example IDs are never nullable in our swagger.json, the generated code is always nullable, no matter which one.
Related issues/PRs
Suggest a fix
On SO somebody suggested a workaround, but I strongly think this is a bug.