[spring] Adapt HttpHeaders access to remain compatible with Spring 7#21691
[spring] Adapt HttpHeaders access to remain compatible with Spring 7#21691wing328 merged 2 commits intoOpenAPITools:masterfrom phactum-mnestler:feature/spring_7_compatibility
Conversation
|
@wing328 and @typat, feel free to give input. As mentioned in the description, this change should be compatible from Spring 6.1.15 to Spring 7.0.0-M7. |
typat
left a comment
There was a problem hiding this comment.
these changes look good to me! thanks for making these updates. I'll test this today in my project as well and report if there are any issues.
|
thanks for the pr i'll try to include it in the upcoming release |
|
@phactum-mnestler one question ... what happens if a project which is still using springboot 3.5.x update to the new openapi-gen version? I guess then the generated client code will have compiler errors because the surrounding project still using "older" springboot. In my project I'm using the openapi-generator-maven-plugin. But I include only the generated java-code into my surrounding project. |
|
@ahoehma Spring Boot 3.5 ships with at least Spring Web 6.2.7, so it should be compatible with this change. If you'd like, try this out in your project and let us know if anything breaks! |
…penAPITools#21691) * [spring] Adapt HttpHeaders access to remain compatible with Spring 7 * update pom.xml patch version
As discussed in #21628, breaking changes in Spring 7
HttpHeadersare incompatible with the currently generated code. In particular,HttpHeaders#containsKeyandHttpHeaders#entrySetwill no longer be available.Because the replacement for
entrySet,headerSet, only became available in Spring Web 6.1.15, this PR also bumps the Spring Web patch version generated by therestclientlibrary from 6.1.6 to 6.1.21. If this is considered a breaking change, feel free to retarget the PR for 8.x accordingly.This PR does NOT modify the
webclientgenerator, as that generator still generates a Spring Boot 2.7 project and thus does not have theheaderSetmethod available without a breaking change.To verify this change:
restclientor (resttemplatewithuseSpringBoot3enabled)PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)