-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Path Parameter annotations in interface are parsed as body param #1506
Comments
This is using which version? |
1.5.4-SNAPSHOT Master branch |
same problem for me |
@ssoltanid can you create a pull request? Looks like a proposed solution is above. |
I have the same issue where swagger won't look for jax-rs annotations in interface. Interface:
Implementation:
|
@mohitmutha, @ssoltanid, @nooruddin - 1.5.9-SNAPSHOT has been pushed with the merged PRs that are meant to fix the issue. Can you give it a try and confirm it resolves the case? |
I pulled out latest snapshot and plugged it in. It's seamlessly working now. |
In jersey, I guess annotation inheritance works for method level. But one does need to specify the produces and path annotations at implementation class level. So in that sense, every other annotations are inherited from interface properly now. |
Great! Works as expected now. |
When the @PathParam is annotated only to the interface method it is parsed as a body parameter in the swagger.json.
I have a interface for my endpoint which describes the JAX-RS endpoint. I want to have the JAX-RS annotations in the interface and the swagger annotations in the implementation
In the case above the id parameter is parsed as a body parameter.
I think the reason for this is the way parameter annotations of a method are read in the Reader.java (line 838).
Because of this only the annotations on the child method get parsed and the ones defined in the interface are not parsed.
I have created a workaround in ReflectionUtils.java to parse the parameter annotations in the base classes and interface as well. Please let me know if the same is acceptable
The text was updated successfully, but these errors were encountered: