We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When generating the ApiClient for Spring RestClient, the Constructor accepts an ObjectMapper, but it is ignored if a RestClient is passed as argument.
openapi-generator-maven-plugin.version: 7.8.0
Generated Code:
public ApiClient(RestClient restClient, ObjectMapper mapper, DateFormat format) { this(Optional.ofNullable(restClient).orElseGet(() -> buildRestClient(mapper.copy())), format); } private ApiClient(RestClient restClient, DateFormat format) { this.restClient = restClient; this.dateFormat = format; this.objectMapper = createDefaultObjectMapper(format); this.init(); }
Expected Code:
public ApiClient(RestClient restClient, DateFormat format) { this(restClient, createDefaultObjectMapper(format), format); } public ApiClient(RestClient restClient, ObjectMapper mapper, DateFormat format) { this.restClient = restClient; this.dateFormat = format; this.objectMapper = mapper; this.init(); }
<build> <plugins> <plugin> <groupId>org.openapitools</groupId> <artifactId>openapi-generator-maven-plugin</artifactId> <executions> <execution> <id>generate-adobe-analytics-streaming-ingestion-api</id> <goals> <goal>generate</goal> </goals> <configuration> <inputSpec>${project.basedir}/src/main/openapi/openapi.yaml</inputSpec> <generatorName>java</generatorName> <library>restclient</library> </configuration> </execution> </executions> </plugin> </plugins> </build>
The text was updated successfully, but these errors were encountered:
Fix java rest client's ApiClient constructors to make sure objectMapp…
ef8fe30
…er parameter is used in the client (OpenAPITools#19667)
71eaa08
a82475e
…er parameter is used in the client (#19667) (#19795)
Successfully merging a pull request may close this issue.
Bug Report Checklist
Description
When generating the ApiClient for Spring RestClient, the Constructor accepts an ObjectMapper, but it is ignored if a RestClient is passed as argument.
openapi-generator version
openapi-generator-maven-plugin.version: 7.8.0
OpenAPI declaration file content or url
Generated Code:
Expected Code:
Generation Details
The text was updated successfully, but these errors were encountered: