Closed szhajdu closed 2 years ago
I understand your point, but:
Most probably this is a design issue, but there are legacy APIs and I can imagine that something is depends on this functionality. The optional nullable properties are part of openapi specification and it should be supported by the generator as well, or at least marked as unsupported feature and generation should fail in these situations, otherwise the generated code won't match with the specification and it could lead to unexpected issues on the user side.
it's misleading indeed, added PR with your suggestion, thx
The toArray method in generated request body class will always send each optional properties to the endpoint:
If I remove the nullable: true modifier, it will generate optional properties, but it won't be nullable anymore:
I think the request object should know if a property has been set or not instead of checking default null values. Maybe maintain flags or use some specific value for it.