spring-projects / spring-projects/spring-framework
Refine `ResolvableType` type variable resolution
Open
@sdeleuze is already working on this.
Since Nov 14, 2024.
in: core
type: enhancement
- Dominant language
- Java
- Stars
- 60.2k
- Forks
- 38.8k
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 27
Description
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 thegetGeneric(0)use case, and most users missGenericTypeResolverthat 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.