OpenAPITools / OpenAPITools/openapi-generator
[REQ][BUG] Interface level @Consumes & @Produces annotations
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
I'm seeing the capability of adding @Consumes and @Produces annotations for both interface and method level. See links below:
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache#L27-L28
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache#L37-L38
But no matter what I tried, I wasn't able to have them appear at Interface level. Can you please provide guidance on how to accomplish this?
Thank you
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
Start with modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache, especially lines 27-28 and 37-38, and compare the generated interface with its methods. Determine why @Consumes and @Produces are not appearing at interface level. Done means the relevant generated Java JAX-RS interface includes the requested annotations while method-level annotations remain supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100