Fixes #24498

Added unboxing of java.util.Optional to AbstractHttpMessageConverter and AbstractGenericHttpMessageConverter. If the object is not unboxed, the underlying message converter receives an instance of java.util.Optional, which was causing an issue described in the #24498 in case of Jackson converter. It will also allow to use Optional<*> in other message converters without explicitly registering a type converter.

Comment From: encircled

@sbrannen just a kind reminder. Lets review&merge or close it if you think that such behaviour should not be part of the product

Comment From: daniel-shuy

Any update for this PR?

Comment From: poutsma

Thank for for submitting a PR, and our apologies for taking this long to resolve it.

We have decided to resolve the underlying issue differently than suggested in this PR, in the Jackson converters rather than the generic converters. See https://github.com/spring-projects/spring-framework/commit/5502e6151967afaef7fa3d9d057f3e2d226a0c84 for more details.

Comment From: sbrannen

  • Superseded by #24498