swagger-api / swagger-api/swagger-codegen
[jaxrs-jersey] 3.0.0 error found running sample with useTags libbrary
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
This error is present for jersey1 and jersey2 libraries, generator works fine and output code can be build with mvn package, however when we try to run sample with mvn jetty:run we got a long error message like this:
Validation of the application resource model has failed during application initialization.
[[FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public javax.ws.rs.core.Response io.swagger.api.StoreApi.getInventory(javax.ws.rs.core.SecurityContext) throws io.swagger.api.NotFoundException
and public javax.ws.rs.core.Response io.swagger.api.StoreApi.getOrderById(java.lang.Integer,javax.ws.rs.core.SecurityContext) throws io.swagger.api.NotFoundException at matching regular expression /Store. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@259b85d6',
[FATAL] A resource model has ambiguous (sub-)resource method for HTTP method POST and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public javax.ws.rs.core.Response io.swagger.api.UserApi.createUser(io.swagger.model.User,javax.ws.rs.core.SecurityContext) throws io.swagger.api.NotFoundException
and public javax.ws.rs.core.Response io.swagger.api.UserApi.createUsersWithArrayInput(java.util.List,javax.ws.rs.core.SecurityContext) throws io.swagger.api.NotFoundException at matching regular expression /User. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@48eaf42f',
Swagger-codegen version
3.0.0
Swagger declaration file content or url
https://gist.github.com/HugoMario/5292d9936367ac145ba80e895793e003
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the sample described in the issue by running mvn package and then mvn jetty:run with the linked Swagger declaration and useTags library. Inspect the generated JAX-RS resource methods named in the error; done means the sample starts without Jersey's ambiguous GET/POST resource-model validation failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100