Skip to content

[BUG] openapi-generator-maven-plugin v7.13.0 duplicates schemas/models when openapi v3.1.x is used #21432

Open
@neiryerit

Description

@neiryerit

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

I'm using the plugin springdoc-openapi-maven-plugin v1.5 to generate the openapi.json file, and the plugin openapi-generator-maven-plugin v7.13.0 to generate the index.adoc file based on the openapi.json generated previously. The openapi.json file is generated with openapi version 3.1.0 but when openapi-generator-maven-plugin is executed, it generates as many schemas/models as they are referenced. e.g:
class Door{}
class Car{ private Door door; }
class House{ private Door door; }

openapi.json contains just one Door schema/model and Car.door and House.door has the ref: #/components/schemas/door which is correct – but when openapi-generator-maven-plugin is executed, the resulting index.adoc file has:

Model Car:

name type
door Door_1

Model House:

name type
door Door_2

Model Door1

name type

Model Door2

name type

if I change manually the version of openapi from 3.1.0 to 3.0.0 into openapi.json, it will work as expected, generating just one schema for 'Door' and setting just one type, not two.

This behaviour means that openapi-generator-maven-plugin is struggling to manage openapi 3.1.x properly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions