-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JAVA][Server] Generated model classes are missing default values #1525
Comments
ccozzolino
added a commit
to ccozzolino/openapi-generator
that referenced
this issue
Nov 27, 2018
…roper initializations.
4 tasks
A-Joshi
pushed a commit
to ihsmarkitoss/openapi-generator
that referenced
this issue
Feb 27, 2019
…nitializations (Regression since 3.3.1) (OpenAPITools#1549) * Fixed issue OpenAPITools#1525. Adjust class field declarations with proper initializations. * Adjusted templates to add default only when it is exists.
This was referenced Jul 31, 2022
This was referenced Jul 31, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Certain java server model classes do not properly declare default values for certain fields. For example, here is the beginning of Pet.java from the samples directory (pulled from
undertow
,vertx-async
,vertx-rx
). Note the missing default value for theid
,name
, andstatus
fields:openapi-generator version
This appears to be a regression since 3.3.1.
Reproduced issue with openapi generator 3.3.1, 3.3.2, 3.3.3, and current master.
Testing against 3.3.0 generates models with proper defaults.
OpenAPI declaration file content or url
Issue is reproducible with certain java server samples (
undertow
,vertx-async
,vertx-rx
) provided in this project for the versions mentioned above.Command line used for generation
Generate models from existing sample servers to reproduce the problem:
mvn clean ; ./bin/java-undertow-petstore-server.sh
mvn clean ; ./bin/java-vertx-async-petstore-server.sh
mvn clean ; ./bin/java-vertx-rx-petstore-server.sh
The text was updated successfully, but these errors were encountered: