spring-projects / spring-projects/spring-framework

Refine `ResolvableType` type variable resolution

Open
#33,887 1 comment 3 reactions 1 assignee View on GitHub

@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 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.