Skip to content

$ref to external component are not add as shared component for open API 3.1 but recreated for each usage #2079

Description

@pkernevez

As describe in this issue OpenAPITools/openapi-generator#18361 I have a difference in the parser behavior.

With 3.0 schema, the reference to an external component is parse with it's own structure. It allow to have a common implementation for things like mapping (an exemple with a comme Amount component that reproduce the issue is available here: https://github.com/pkernevez/pb-openapi).

With 3.1 schema the parsing don't create common components, there are new classes (with the attributes) for each usage.
It's not possible to have shared Dto anymore nor share mapping implementation.

It try with and without setResolveFully (as I saw #1950 that seems to be closed to this issue, but isn't).
Output without setResolveFully
image

Output with setResolveFully
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions