-
Notifications
You must be signed in to change notification settings - Fork 621
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
Adding DeserializationFeature.FAIL_ON_TRAILING_TOKENS in ContextFunctionCatalogAutoConfiguration breaks WebTestClient with HypermediaWebTestClientConfigurer #1148
Comments
Is there any update on this? I'm facing the same issue as well |
Looking |
Part of the issue is that Hateos (which you are using) is registering (overriding) it's own
. . and set it if exist. |
I'll take that back, apparently you can, so let me remove it and let other users know that they can set it manually as:
|
Related - #1094 |
I am going to revert this change since the problem has nothing to do with s-c-function as it is not even part of the stack trace of the failure. The issue i suspect is that Hateos have provided their own ObjectMapper over the one from boot and we are simply using it. |
Hi @olegz , Thanks |
Same problem here, the simple fact of including spring-cloud-function changes the behaviour of the default objectMapper by adding FAIL_ON_TRAILING_TOKENS. I agree that spring cloud function probably needs must have its own objectMapper if you need to change settings ... @olegz : this issue should be open again if the code that goes with it has been reverted, no ? |
Hello Is there a plan to fix this here? |
This reverts commit 8b66fd2
Apologies if this is not the place to raise this, but I've had numerous issues moving my Spring Boot app from Spring Cloud 2023.0.1 to 2023.0.2/3, all of which seem to be related to the fact that parts of spring cloud are rolling their own fasterxml ObjectMapper and not taking account of spring boot-based customization. I've hit this with
If my guess is correct, are all of these related issues going to be addressed in 2024.0.0? TIA |
To be blunt, this change broke so many things. Who thought it'd be a good idea to inject your own |
Would be great to inform us when this fix will be released (milestone is not enough for my case). |
is the issue solved? in 2023.0.4 I have test errors Trailing token (of type END_OBJECT) found after value (bound as How can I disable FAIL_ON_TRAILING_TOKENS when I inject ObjectMapper? Spring properties have no effect. |
@olegz It seems that for Spring Cloud 2023.0.4 fail again. In Spring Cloud 2023.0.3 version it was fixed. We also have the same problem again with projects using Spring Cloud Bus + Spring Cloud 2023.0.4. With the demo.zip of this same issue it is reproduced by upgrading to Spring Boot 3.3.6 + Spring Cloud 2023.0.4. |
stupid workaround, but works
|
@kubav182 this workaround works correctly! but for Spring Cloud version 2023.0.3 it was not necessary... |
Downgrading only the Is it possible that it could be due to this change? |
@olegz i confirm that the issue occurs with Spring Boot 3.3.6 and Spring cloud 2023.0.4.
You think that Spring Hateaos should investigate the problem : do you reopen this issue spring-projects/spring-hateoas#2158 ? |
In 4.2.0 you can do... @Bean
public JacksonMapper jsonMapper(ObjectMapper objectMapper) {
objectMapper.addMixIn(...whatever...)
return new JacksonMapper(objectMapper);
} |
Describe the bug
We start by migrating our applications to Spring Boot 3.2.6, Spring Cloud 2023.0.2, these applications have these dependencies: spring-boot-starter-hateoas, spring-boot-starter-webflux and
spring-cloud-stream-test-binder / spring-cloud-starter-bus-amqp / ... any dependency that uses "spring-cloud-function-context", this last dependency breaks all tests because of adding "mapper .configure(DeserializationFeature.FAIL_ON_TRAILING_TOKENS, true);" in ContextFunctionCatalogAutoConfiguration in the version used by 2023.0.2..
No problem with Spring Boot 3.2.6, Spring Cloud 2023.0.1 .
Sample
demo.zip
Launch test PbHalApplicationTests#createTestAndCheck :
this error is raised :
The text was updated successfully, but these errors were encountered: