OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.94k stars 6.59k forks source link

[BUG] Unnecessary model package import in JSON causes ambiguous class reference #20125

Closed beikov closed 4 days ago

beikov commented 5 days ago

Bug Report Checklist

Description

Using the Jira OpenAPI spec, a model class called JsonNode causes a compilation issue in the generated JSON class, because that unnecessarily imports all model classes.

openapi-generator version

All of them.

OpenAPI declaration file content or url

https://dac-static.atlassian.com/cloud/jira/platform/swagger-v3.v3.json

Generation Details

Use Jersey 2 or 3 with Jackson.

Steps to reproduce

Just generate the models for that spec and observe the compilation error.

Related issues/PRs

https://github.com/OpenAPITools/openapi-generator/pull/20124

Suggest a fix

See PR