Closed pzienowicz closed 1 year ago
Yes. It can be fixed. Can you post a PR with the proposed change. It will be super helpful
this should be fixed in 4.2.0
. Note that no change to the code was required. I was mistakenly still building against spring 5 not 6.
Sorry, but code change is required in this case.
As I mentioned, in sprint 6 there is no status(HttpStatus status)
function, please check documentation:
https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/reactive/function/server/ServerResponse.html
But code from Validator
still uses this function that was existing in spring 5:
https://docs.spring.io/spring-framework/docs/5.3.24/javadoc-api/org/springframework/web/reactive/function/server/ServerResponse.html
Do you have any tests that cover it?
There are multiple existing tests that test this code path
Note that HttpStatus
implements HttpStatusCode
, hence it is still valid to pass an instance of HttpStatus
as an arg
Here is a screenshot within debugger showing this code path as driven by one of the existing unit tests tests. As you can see, an HttpStatus
is passed into the ServerResponse.status(HttpStatusCode status)
method that you describe above successfully (no issue)
Have you tried v4.2.0
. I suspect the issue you're encountering is due to the fact that v4.0
and v4.1
were (incorrectly) compiled against spring boot 2 instead of 3. 4.2.0
corrects that
You are right, now all good, thanks!
Hi @cdimascio ! Please take a look into Validator class, in line 30 i 44 it uses
status
function fromServerResponse
. In spring 6 there is nostatus(HttpStatus status)
function, you need to usestatus(HttpStatusCode status)
instead. Can you fix it?Full error log:
java.lang.NoSuchMethodError: 'org.springframework.web.reactive.function.server.ServerResponse$BodyBuilder org.springframework.web.reactive.function.server.ServerResponse.status(org.springframework.http.HttpStatus)'