You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've generated Java clients using the restTemplate library from my openapi.yaml file. One of the schema properties is defined as a primitive boolean, but in the generated model, it has been converted to the boxed type Boolean. This behavior is not desired in my case.
Is there a way to configure the OpenAPI Generator CLI to preserve primitive types and prevent them from being overridden as boxed types?
Thank you in advance for your help.
Best regards.
The text was updated successfully, but these errors were encountered:
Thanks for the response. Definitely perfect solution. My issue was the fact that in the source code, using primitive types i.e. boolean comes with default value, i.e. false. However after generating openapi, and from it, generate clients, the generated Java class will utilise Boxed types i.e. Boolean, with null value.
I address that with @Schema(defaultValue=“false”) on the source, so the generated Java class comes with default value i.e. false.
Thanks by the way.
Hi,
I've generated Java clients using the restTemplate library from my openapi.yaml file. One of the schema properties is defined as a primitive boolean, but in the generated model, it has been converted to the boxed type Boolean. This behavior is not desired in my case.
Is there a way to configure the OpenAPI Generator CLI to preserve primitive types and prevent them from being overridden as boxed types?
Thank you in advance for your help.
Best regards.
The text was updated successfully, but these errors were encountered: