spring-framework icon indicating copy to clipboard operation
spring-framework copied to clipboard

Refine `ResolvableType` type variable resolution

Open sdeleuze opened this issue 1 year ago • 1 comments

While exploring using ResolvableType in Spring AI with @tzolov and Spring Cloud Function with @olegz, we figured out that the type variable algorithm is not working as expected in all use cases.

This gist illustrates various use cases where either:

  • Type resolution does not happen despite the information provided beeing enough to resolve them
  • GenericTypeResolver#resolveType(Type, Class<?>) is required for the getGeneric(0) use case, and most users miss GenericTypeResolver that is not easily discoverable.

The purpose of this issue is to refine the type resolver to cover the broken use cases, and to explore if that would make sense or not to provide GenericTypeResolver#resolveType(Type, Class<?>) capabilities as part of ResolvableType.

sdeleuze avatar Nov 14 '24 15:11 sdeleuze