OpenAPITools / OpenAPITools/openapi-generator

[REQ][BUG] Interface level @Consumes & @Produces annotations

Open
#10,664 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.