Skip to content
This repository has been archived by the owner on Oct 24, 2018. It is now read-only.

Does not handle methods not annotated with @Path #4

Closed
newjam opened this issue Feb 14, 2014 · 1 comment
Closed

Does not handle methods not annotated with @Path #4

newjam opened this issue Feb 14, 2014 · 1 comment
Assignees

Comments

@newjam
Copy link

newjam commented Feb 14, 2014

It is perfectly valid according to jax-rs spec to have a method in a resource that is not annotated with @path. For example:

@Path("/foo")
interface MyResource {
    @GET
    Foo getFoo();
}

This would cause:

[ERROR] Failed to execute goal jp.co.worksap.jax_rs:js-generator-for-jax-rs:1.0.0:generate (default) on project edu-api-demo: InvocationTargetException occurs: The annotated element, public my.package.MyResource my.package.MyResource.getFoo() is not annotated with @path -> [Help 1]

@KengoTODA KengoTODA added the bug label Feb 15, 2014
@KengoTODA KengoTODA self-assigned this Feb 15, 2014
@KengoTODA
Copy link
Collaborator

Thanks for your contribution,

I think it is NOT supported by JAX_RS specification that adding annotation onto interface. I'll quote the discussion at Jira:

JAX-RS does not support inheritance of annotations applied to interface types. The statement quoted refers to interfaces methods (and should be clarified). Annotations such as @path are intended for resource classes (which by definition must be concrete classes).

So currently we have no plan to support this case. I recommend you to modify your code to follow JAX_RS specification strictly.

KengoTODA added a commit that referenced this issue Feb 24, 2014
@KengoTODA KengoTODA removed the bug label Feb 27, 2014
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

2 participants