Frank Schröder - 2009-09-26

Hi RESTeasy team,

I am using **RESTeasy 1.1.GA** and have a lot of **simple CRUD services** which service only a single entity. Therefore I got **a lot of interfaces** which look like this

    @Path("/user")
    @Produces("application/json")
    @Consumes("application/json")
    public interface UserService
    {
        @PUT
        @Path("/")
        public void add(User user);
   
        @DELETE
        @Path("/{userId}")
        public void delete(@PathParam("userId") long userId);
   
        @GET
        @Path("/{userId}")
        public User get(@PathParam("userId") long userId);
   
        @PUT
        @Path("/{userId}")
        public void update(@PathParam("userId") long userId, User user);
    }

What I would like to do is something like this

    @Produces("application/json")
    @Consumes("application/json")
    public interface CRUDService<E>
    {
        @PUT
        @Path("/")
        public void add(E e);
   
        @DELETE
        @Path("/{id}")
        public void delete(@PathParam("id") long id);
   
        @GET
        @Path("/{id}")
        public E get(@PathParam("id") long id);
   
        @PUT
        @Path("/{id}")
        public void update(@PathParam("id") long id, E e);
    }
   
    @Path("/user")
    public interface UserService extends CRUDService<User> {}

However, that only works for the GET methods. For the PUT methods I get

    Could not find JAXBContextFinder for media type: application/json

What am I doing wrong or isn't this currently possible?

Thanks
Frank