Repository navigation
Closed
Labels
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
After upgrading the openapi-generator-maven-plugin to 7.20.0 I tried the new options useJackson3 and useSpringBoot4 (see #22854)
I still get the messages
- [removal] MappingJackson2HttpMessageConverter in org.springframework.http.converter.json is deprecated and marked for removal
- [removal] messageConverters(Consumer<List<HttpMessageConverter<?>>>) in Builder is deprecated and marked for removal
openapi-generator version
7.20.0
OpenAPI declaration file content or url
Generation Details
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>7.20.0</version>
<executions>
<execution>
<id>generate-client</id>
<goals>
<goal>generate</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<inputSpec>
${project.build.directory}/generated-resources/src/main/resources/api/openapi.yaml
</inputSpec>
<generatorName>java</generatorName>
<configOptions>
<library>restclient</library>
<useJakartaEe>true</useJakartaEe>
<dateLibrary>java8</dateLibrary>
<useJackson3>true</useJackson3>
<useSpringBoot4>true</useSpringBoot4>
<implicitHeaders>true</implicitHeaders>
<invokerPackage>faltfe.service</invokerPackage>
<configPackage>faltfe.config</configPackage>
<apiPackage>faltfe.api</apiPackage>
<modelPackage>faltfe.model</modelPackage>
</configOptions>
<generateModelTests>false</generateModelTests>
<generateApiTests>false</generateApiTests>
</configuration>
</execution>
</executions>
</plugin>With the java configuration
@Configuration
@RequiredArgsConstructor
public class IamsConfiguration {
private final ArmsProperties armProperties;
@Bean
public ApiClient apiClient() {
var apiClient = new CustomApiClient().apiClient();
apiClient.setBasePath("http://localhost:8000");
return apiClient;
}
@Bean
public UserApi userApi(ApiClient apiClient) {
return new UserApi(apiClient);
}
private class CustomApiClient extends ApiClient {
ApiClient apiClient() {
var restClient = this.restClient.mutate().requestInterceptor((request, body, execution) -> {
request.getHeaders().add("tenant", "Foobar");
return execution.execute(request, body);
});
return new ApiClient(restClient.build());
}
}
}Steps to reproduce
Generate any YAML input spec the see the log messages from Maven. There are at least two warnings about the deprections.
Related issues/PRs
Suggest a fix
I would expect that there is no warning when using Jackson3.
Activity
faltfe commentedon Feb 16, 2026
Btw., the documentation appears to be unchanged since version 7.20.0
https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/java.md Jackson 3 is not mentioned there
Picazsoo commentedon Feb 17, 2026
I see in your config:
<generatorName>java</generatorName>The issue title mentions spring and yet you are using java generator in your config.
I am quite certain that the functionality has been implemented only in the java-spring codegen (commonly refered to in the issues as java-spring to differentiate it from kotlin-spring). And I can see jackson3 mentioned in the docs: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/spring.md
So if you want to use it, you should do:
<generatorName>spring</generatorName>faltfe commentedon Feb 17, 2026
Thanks for your response. As I want to generate a client not a server from the API spec I currently use the
<library>restclient</library>which generates a Spring client. Therefore, I guess, it is not a bug it is a feature request to support Spring Boot 4 and Jackson 3 with the RestClient.Picazsoo commentedon Feb 17, 2026
Have you considered going the spring http declarative interface route? (available in
springgenerator asspring-http-interfacelibrary). If it is suitable for your needs, you can use it easily with RestClient.And regarding the support in
javagenerator - I presume it will come in due time. Someone will have to implement it once they feel the need for it. You could be that someone (-:Just to make it clear - I am not a maintainer of this project. We just use it extensively at our company and I am compelled to give back at least a little.
faltfe commentedon Feb 19, 2026
I try to change the generator to
springwith<library>spring-http-interface</library>. Unfortunately, it fails with<useSpringBoot4>true</useSpringBoot4>because of missing imports in the generated Api classes.Imports are missing for
@Parameter@ParameterInI also tested
<annotationLibrary>swagger2</annotationLibrary>and without<useSpringBoot4>true</useSpringBoot4>. The result was always an compilation error caused by missing imports. Manually importing is possible.When I use
<useSpringBoot3>true</useSpringBoot3>the generation fails as well with the error:Picazsoo commentedon Feb 19, 2026
Ok, let me check this. I remember this being tricky.
Picazsoo commentedon Feb 19, 2026
can you try to set documentationProvider to none?
alex-nt commentedon Feb 21, 2026
Maybe this will help? #23023
faltfe commentedon Feb 23, 2026
With documentProvider set to none the code compiles. The only problem is now that the generates methods return
ResponseEntity<Object>instead ofObjectlike before with RestClient. But I can refactor this.That looks promising. I'm looking forward to test it in the next release.
Picazsoo commentedon Feb 23, 2026
try setting "useResponseEntity" to "false" in additional properties
faltfe commentedon Feb 25, 2026
Using useResponseEntity as configOption is working
Maven builds the project successfully but I have an issue with exploded parameters.
I have OpenAPI definition like
They are all defined like
The generated code
When I run a request again the generated API client I get an error because the object is not exloded like before with the RestClient. As I'm new to HTTP interfaces with Spring Boot, I'm not sure yet, if it is a configuration issue or if there is something missing in the generated files. The exception is that there is no resolver for parameter [0].
Picazsoo commentedon Mar 5, 2026
Hi @faltfe , since the fix is merged in #23023, I guess you can close this? Or are you waiting to really test it before closing the issue? Makes sense - just asking.
faltfe commentedon Mar 17, 2026
I would like to wait for a release to test this. Otherwise, you can close it, when this is your workflow in this project. I will open a new issue when the problem is not solved in the next release.
Picazsoo commentedon Mar 17, 2026
Makes sense to keep it open. The release is just days from now anyways.
wing328 commentedon Mar 17, 2026
please help test the latest master if you've time: https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-to-test-with-the-latest-master-of-openapi-generator
faltfe commentedon Mar 25, 2026
With the latest release 7.21.0
<useSpringBoot4>true</useSpringBoot4>with restclient is working