spring-projects / spring-projects/spring-framework
Provide declarative AOT binding type metadata for WebMvc.fn routes
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 60.2k
- Forks
- 38.8k
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 27
Description
Proposal
Provide declarative AOT binding type metadata for WebMvc.fn routes.
WebMvc.fn handler functions expose only ServerRequest and ServerResponse.
As a result, request and response body types are not visible in handler method
signatures and cannot be discovered in the same way as annotated controllers.
Applications currently need to maintain a separate list such as:
@RegisterReflectionForBinding({
CreateRequest.class,
Result.class,
UserResponse.class
})
This is easy to forget when adding or changing a route.
Would Spring Framework consider adding a typed declaration mechanism to the
WebMvc.fn router or response builder, allowing request and response binding
types (including ParameterizedTypeReference) to be associated with a route
and processed automatically during AOT?
The goal is not to analyze arbitrary handler bytecode, but to provide an
official declarative API colocated with each functional route.
This could potentially also be considered for WebFlux.fn for API parity.
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.
Research direction
Review the WebMvc.fn router and response-builder entry points, then compare their AOT handling with annotated controllers. Determine the scope of a declarative route-level API, including ParameterizedTypeReference and possible WebFlux.fn parity; done means the agreed metadata is processed automatically during AOT.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100