-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Spring 7 WebClient Compatibility #22030
New issue
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
Spring 7 WebClient Compatibility #22030
Conversation
Thanks for the PR.
I ran the above against the master but the result is green (project compiles). Am I supposed to get errors or the issues only occur during runtime? |
This should be a compile time error. When I
I get
|
still no luck. it compiles fine:
I'm using JDK17 (on Windows). Not sure if it matters. |
I'm on 24. I'll test whether that makes a difference, but I'd be surprised honestly. |
Java 17 behaves identically. |
If I read your build correctly it seems you did not clean before testing. I would assume the JAR you're testing against is still depending on Spring Boot 3 and Maven didn't see the need for a rebuild to resolve against Spring Boot 4. |
Ah you're right. Now I can reproduce the issue and able to confirm your fix addressed the compilation errors. Thanks for the contribution. Let's give it a try |
As addressed in #21628 Spring Framework 7 changes the
HttpHeader
type in a way that's not compatible with the current Spring WebClientApiClient
code generated by OpenAPI.This PR adapts the changes from #21691 for WebClient.
The new
HttpHeader
methods become available with Spring Boot 3.2, which is why I updated from3.0.12
to3.2.12
.Similar to mentioned PR one can verify operation with
webclient
for JakartaEEmvn integration-test -f samples/client/petstore/java/webclient-jakarta/pom.xml
)Unfortunately I wasn't able to run more than the integration tests, i.e. I did not spin up an actual server yet.
Mentioning Java Spring committee members: @cachescrubber , @welshm , @MelleD , @atextor , @manedev79 , @javisst , @borsch , @banlevente , @Zomzog , @martin-mfg
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.0
minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)"fixes #123"
present in the PR description)