OpenAPITools / OpenAPITools/openapi-generator

[REQ] Hide @ApiIgnore when using useSpringfox=false

Open
#9,604 1 comment 6 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.

I'm using spring generator with springfox disabled (useSpringfox=false).
However, the generated API still contains springfox ApiIgnore import reference. In my setup this is an unused import, since it is only required when you have vendorExtensions.x-spring-paginated or reactive enabled.

Describe the solution you'd like

I think we can duplicate this import inside both reactive and vendorExtensions.x-spring.paginated sections. This way it will not be present by default and will be defined if either of flags is enabled. It will be defined twice if both flags are true, but it doesn't look like an issue to me.

Describe alternatives you've considered

We can also simply hide the import itself with useSpringfox=false, but this will make an implicit dependency on this flag when we enable reactive or vendorExtensions.x-spring-paginated.

Additional context

I can make a PR if the solution is ok or would be glad to hear other options.

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 modules/openapi-generator/src/main/resources/JavaSpring/api.mustache, reviewing the ApiIgnore import and the reactive and vendorExtensions.x-spring-paginated sections. Check generated JavaSpring APIs with useSpringfox=false and confirm the import is absent by default but present when either relevant option requires it.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.