While stepping through the code I noticed that the Jackson2JsonDecoder.getDecodableMimeTypes() and Jackson2JsonEncoder.getEncodableMimeTypes() methods always return the default JSON mime types, not the one(s) provided as constructor argument.
hi, small correction. The Jackson2CodecSupport.supportsMimeType method does refer to the list of configured mime types. It's getDecodableMimeTypes and getEncodableMimeTypes that are effectively hard-coded. As a result the BodyExtractors on the client side and the argument resolver on the server side do not perform content negotiation correctly, which is why I also don't follow the comment that it works when using the WebClient.Builder.
Regardless of this, there is an actual issue and the fix looks right. I will however adjust the tests to verify what is actually failing.
small correction. The Jackson2CodecSupport.supportsMimeType method does refer to the list of configured mime types
Yes, this was an incorrect observation by me. I modified my pull request comment but forgot to update it here as well.
spring-projects-issues commentedAug 16, 2017
•
edited
Ricardo Lindooren opened SPR-15866 and commented
I'm using
Webclient
to consume a webservice that uses a legacy mime type for JSON:text/javascript
.This works when using the Webclient builder.
But when trying to configure this on application level it doesn't work.
While stepping through the code I noticed that the
Jackson2JsonDecoder.getDecodableMimeTypes()
andJackson2JsonEncoder.getEncodableMimeTypes()
methods always return the default JSON mime types, not the one(s) provided as constructor argument.Causing
Jackson2CodecSupport.supportsMimeType
to returnfalse
for the provided mime types.Looks related to #20034
I created this PR with a proposed change: 1499
Affects: 5.0 RC3
Referenced from: commits bb327b9
The text was updated successfully, but these errors were encountered: