Bug Report Checklist
Description
The generator does not generate the default constructor if it is the only constructor. This is problematic, e.g., when such a class is in a package that is exported by a Java module and the module is compiled with javac -Xlint:all -Werror, because it fails the lint check missing-explicit-ctor.
openapi-generator version
v7.24.0
OpenAPI declaration file content or url
openapi.yaml
Generation Details
config.json
Steps to reproduce
- in a directory X, create
openapi.yaml and config.json with the contents as above
- from within X, run
docker run --rm -v .:/local openapitools/openapi-generator-cli:v7.24.0 generate --strict-spec true --input-spec /local/openapi.yaml --generator-name spring --config /local/config.json --output /local/output
- open
.\output\src\main\java\org\openapitools\model\Foo.java
actual: the default constructor is not generated
expected: the default constructor is generated
Related issues/PRs
Suggest a fix
I assume this will require an update to the pojo.mustache template.
Bug Report Checklist
Description
The generator does not generate the default constructor if it is the only constructor. This is problematic, e.g., when such a class is in a package that is exported by a Java module and the module is compiled with
javac -Xlint:all -Werror, because it fails the lint checkmissing-explicit-ctor.openapi-generator version
v7.24.0
OpenAPI declaration file content or url
openapi.yaml
Generation Details
config.json
Steps to reproduce
openapi.yamlandconfig.jsonwith the contents as abovedocker run --rm -v .:/local openapitools/openapi-generator-cli:v7.24.0 generate --strict-spec true --input-spec /local/openapi.yaml --generator-name spring --config /local/config.json --output /local/output.\output\src\main\java\org\openapitools\model\Foo.javaactual: the default constructor is not generated
expected: the default constructor is generated
Related issues/PRs
Suggest a fix
I assume this will require an update to the
pojo.mustachetemplate.