-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@RestDoc should be allowed on classes (which model subresources) #18
Comments
RestDoc resources have to be callable endpoints so only methods can be annotated. Subresources are only parts of the endpoint. |
Maybe, I don't get, what a callable endpoint is :). I have the URL http://.../winery/winerypropertiesdefinition, where I can POST to. Is that an endpoint? public class WinerysPropertiesDefinitionResource {
@POST
@RestDoc(methodDescription = "switches the mode to winery properties")
public Response onPost() {
// ...
}
} That resource is created by the parent resource. @Path("winery/")
public WinerysPropertiesDefinitionResource getWinerysPropertiesDefinitionResource() {
return new WinerysPropertiesDefinitionResource();
} I see that I could make the annotation there. I currently think it is better positioned at the place where the actual implementation (or interface definition ;)) resides. |
I see the problem, I think I will split resourceDescription and methodDescription into separate annotations. That may solve the problem. |
👍 |
I'm using classes as subresources, which are instantiated by the parent resource. I tried to annotate that resource class with
@RestDoc(resourceDescription = "...")
, but the locationclass
is not allowed for@RestDoc
.The text was updated successfully, but these errors were encountered: