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.
Proposal
Provide declarative AOT binding type metadata for WebMvc.fn routes.
WebMvc.fn handler functions expose only
ServerRequestandServerResponse.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:
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 routeand 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.