-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
proposalProposed Specification or API changeProposed Specification or API changewaiting for votesEnhancements or changes proposed that need more support before considerationEnhancements or changes proposed that need more support before consideration
Description
It would be nice if via an annotation at class or method level, there could be a means of specifying an implentation that could supply dynamic values to contexts. Consider the following examples:
@VariableContext(alias = "varCtx", supplier = TheValueSupplier.class)
public class Example {
@Headers({
"accept: application/json",
})
@RequestLine("GET /api/{varCtx}/someEntity/{id}")
SomeEntity getById(@Param("id") Long id);
}As it is obvious, the {varCtx} does not need to be passed explicitely via the method's argument. It would also be nice to give the same annotation precedence if placed over a method while one is marking the enclosing class too.
I think this is very handy for cases where a dynamic switch of APIs is needed e.g. between versions (/api/v1/my/path to /api/v2/my/path) or other circumstances (/api/my/path to /api/session/my/path)
Metadata
Metadata
Assignees
Labels
proposalProposed Specification or API changeProposed Specification or API changewaiting for votesEnhancements or changes proposed that need more support before considerationEnhancements or changes proposed that need more support before consideration