OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
If you add -Xlint:all, -Werror to java compiler options, you will get error on any open-api specification.
When apache-httpclient as a library is used, the generator generates code with [this-escape] possible 'this' escape before subclass is fully initialized warnings in ApiClient.
When native as a library is used, the generator generates code with [rawtypes] found raw type: Collection warnings in ApiClient.
Bug Report Checklist
Description
If you add -Xlint:all, -Werror to java compiler options, you will get error on any open-api specification.
apache-httpclient
as a library is used, the generator generates code with[this-escape] possible 'this' escape before subclass is fully initialized
warnings in ApiClient.native
as a library is used, the generator generates code with[rawtypes] found raw type: Collection
warnings in ApiClient.openapi-generator version
7.4.0
OpenAPI declaration file content or url
https://github.com/OpenAPITools/openapi-generator/blob/1105759a6f20edac389fa547359c7d5e6c4f9ac8/modules/openapi-generator-gradle-plugin/samples/local-spec/petstore-v3.0.yaml
Generation Details
Steps to reproduce
jdk: Oracle OpenJDK 21.0.1 gradle: 8.7 open-api generator plugin: 7.4.0
Related issues/PRs
https://github.com/OpenAPITools/openapi-generator/issues/17475
Suggest a fix
apache-httpclient
library: Change the implementation of affected methods with [this-escape] warningsnative
library: Don't use raw type with Collection object (reimplement with generics if possible)