-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@RestClient - the current @Target is wrong #257
Comments
This issue follows up on #232. |
@mkouba: I created a PR to add the missing |
I believe that the correct value is |
@mkouba: Why do you think |
It could be useful when creating mocks: @Path("/echo")
@RegisterRestClient
public interface EchoClient {
@GET
@Produces(MediaType.TEXT_PLAIN)
@Consumes(MediaType.TEXT_PLAIN)
String echo(@QueryParam("message") String message);
}
@Priority(1)
@Alternative // Takes precedence over the bean provided by the MP Rest Client impl
@RestClient
class MockEchoClient implements EchoClient {
public String echo(String message) {
return "mock!";
}
} |
Good idea. I added it to my PR. Thanks for the input! |
The current value is
@Target({ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD})
.ElementType.PARAMETER
).ElementType.TYPE
).CDI qualifiers typically define the target as follows:
@Target({METHOD, FIELD, PARAMETER, TYPE})
.ElementType.CONSTRUCTOR
is completely useless.The text was updated successfully, but these errors were encountered: