OpenAPITools / OpenAPITools/openapi-generator

[REQ] Java - Only import ApiIgnore class when used

Open
#10,112 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

Is your feature request related to a problem? Please describe.

ApiIgnore is imported even if not used. This forces projects to import springfox even if it is not otherwise used.

Describe the solution you'd like

2 potential solutions:

  1. Only import ApiIgnore if needed. In JavaSpring/api.mustache, ApiIgnore is only used if reactive of vendorExtensions.x-spring-paginated is enabled
  2. Add an option to allow enabling/disabling springfox

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 in JavaSpring/api.mustache and inspect how the ApiIgnore import relates to the reactive vendor extension. Confirm which of the two proposed solutions fits the generator's existing template behavior, then verify that generated Java Spring code does not require the springfox import when the annotation is unused.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.