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

Invalid Swagger JSON created for Java methods annotated with same HTTP method and path #67

Open
peterjanes opened this issue Apr 24, 2014 · 0 comments

Comments

@peterjanes
Copy link

I believe the following is valid JAX-RS (at least, it works, in my CXF-based service):

@POST
public Response foo(ClassOne body) {...}

@POST
public Response bar(ClassTwo body) {...}

Currently the doclet will produce an operation object for each method, which breaks swagger.js. (The spec says "In the operations array, there MUST be only one Operation Object per method.")

I'm not sure what the correct way to handle this case is; I initially thought of merging the operations, but it's not clear how to do so since the parameters and responses can differ. For now I've hacked the doclet to recognize @ApiOperation(hidden=true) and skip any processing of the method if it's found.

peterjanes pushed a commit to peterjanes/swagger-jaxrs-doclet that referenced this issue Apr 25, 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

1 participant