inject/restclient not needed for constructor injection in quarkus #708
Open
Description
I get The Rest Client object should have the @Inject and @RestClient annotations to be injected as a CDI bean.microprofile-restclient(InjectAndRestClientAnnotationMissing)
with this code for the api
code which works fine in Quarkus:
@ApplicationScoped
public class AppHAContext implements IHAContext {
private HomeAssistantAPI api;
private HomeAssistantWS ws;
public AppHAContext(@RestClient HomeAssistantAPI api, HomeAssistantWS ws) {
this.api = api;
this.ws = ws;
}
@Override
public HomeAssistantAPI getApi() {
return api;
}
public HomeAssistantWS ws() {
return ws;
}
}
quarkus does automatic constructor injection thus @Inject is not required.
Metadata
Assignees
Labels
No labels