Open arandth opened 8 months ago
Please note that I found a workaround: I simply invoked the generator twice (one call for API only (use-optional=true), the other one for the models only (use-optional=false). That works fine, even when invoked with the openapi-generator-maven-plugin
Still facing the same issue in openapi-generator 7.5.0
Hello, we really need this distinction. The PR https://github.com/OpenAPITools/openapi-generator/pull/17202, was made for its own purposes and as we can see in the thread, a lot of people are bothered by this MAJOR change. (even if I understand the arguments)
So I love the idea of two "useOptionals", one for the API and one for the model. The work around works, but when you call many other RESTApis, doubling the generation becomes cumbersome and a waste of time. We still can use the openApiNullable, but it's hard to find in documentation and not sure it's 100% the same behaviour that before
I was trying to update from openapi-generator 7.1.0 to 7.2.0. That causes problems due to a changed handling of useOptional. In 7.1.0, only methods in API's were treated (not attributes of the generated model classes.) With 7.2.0 that obviously changed, suddenly also the generated model classes have Optional fields (if they are not marked as required). One might argue that this is the correct behavior of the generator, but on the other hand it prevents us from updating - it would be a very hard work to change the implementation in either all APIs or all model classes.
So what we would need is to destinguish between APIs and models (such as "useOptionalInApi" / "useOptionalInModel" or similar). Is that already possible?