Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

ConsumerFactory does not respect @Consumes and @Produces annotations on interface #180

Open
redrezo opened this issue Dec 28, 2016 · 0 comments

Comments

@redrezo
Copy link

redrezo commented Dec 28, 2016

While it is possible to set the default behavior for all service methods by specifing @Consumes and @Produces on the interface itself (which is working just fine with the publisher), the ConsumerFactory seems to only look for those annotations on the method itself.

This interface works fine on the publisher, but not with the consumer (it tries to lookup a provider for plain/text)

@Path("/test")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface TestService {
  @PUT
  @Path("/doIt")
  Model doIt(Model model);
}

while this version also works with the consumer

@Path("/test")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface TestService {
  @PUT
  @Path("/doIt")
  @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
  @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
  Model doIt(Model model);
}

edit: observed in version 5.3.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant