Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [microprofile-dev] Microprofile rest client subresource provider registration

Hi Milan,

The MicroProfile Rest Client 2.0 spec currently does not mention sub-resources at all, though I believe most of the major implementations (CXF, Jersey, and RESTEasy) support them in one fashion or another.  So, the short answer is that no, there is no (portable) support for registering providers for a sub-resource client interface.

In order for the ABCProvider to be registered, you would either need to register it on the Foo interface - or you would need to programmatically register it using the RestClientBuilder API.  

This does sound like an intriguing feature though.  Please feel free to open an issue for this at: https://github.com/eclipse/microprofile-rest-client/issues or even a pull request.

Thanks!

Andy


On Wed, Aug 25, 2021 at 11:10 PM Konzal Milan (PS/EDI1-Bj) via microprofile-dev <microprofile-dev@xxxxxxxxxxx> wrote:

Hi,

is it possible to register providers on the subresouce client proxy? Does it take precedence over provider registration on the parent level?

 

I would like to register different Providers on different sub-resources. Is it expected? I can't find any information in the MP specification.

 

My resource proxy

 

@Path("/foo")

@RegisterProvider(XYZWriter.class)

@RegisterProvider(XYZReader.class)

public interface Foo {

    @POST

    @Consumes("xyz")

    @Produces("xyz")

    FooResponse get(FooContent content);

 

    @Path("/bar")

    Bar getBar();

}

 

My sub resource proxy

 

@RegisterProvider(ABCReader.class)

public interface Bar {

     @POST

     @Produces("abc")

     BarResponse get();

}

 

My call foo.getBar().get();

 

Thanks.

 

Milan

_______________________________________________
microprofile-dev mailing list
microprofile-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/microprofile-dev

Back to the top