OpenAPITools / OpenAPITools/openapi-generator

[BUG][Java] Cannot turn off swagger annotations. -> swaggerAnnotations: false doesn't work.

Open
#11,555 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

I am using the following parameters in a gradle task:
configOptions = [ dateLibrary: "java8", annotationsLibrary: "none" ]
additionalProperties = [ swaggerAnnotations: false, ]
None of the assigned parameters doesn't turn off the annotations by swagger using JAVA generator.
Applied OPEN-GENERATOR Gradle plugin as following:
plugins { id "org.openapi.generator" version "5.4.0" }
Also referring to the previous cases and "solutions".
_This PR doesn't disable all usages of swagger-annotations in 'java' generator templates, opened a more complete one

Originally posted by @baurchanu in https://github.com/OpenAPITools/openapi-generator/issues/8801#issuecomment-943226459_

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 the Java generator templates and the Gradle configuration shown in the issue, then compare the existing swagger-annotations handling with the more complete PR referenced in the report. Done means setting annotationsLibrary to none or swaggerAnnotations to false removes all swagger-annotations usages from generated Java output.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.