Skip to content

Conversation

@pvdbosch
Copy link

Description

Transformation from OpenAPI to JSON draft4 schema modifies the input data, even though cloneSchema: true is used.
This leads to the bug described in #275 when the same schema is transformed multiple times during parsing.

This PR adds a deep clone step before the transformation, and a test case to validate the fix.

Upgrading @openapi-contrib/openapi-schema-to-json-schema might also fix this, but it's backwards-incompatible and I'm not well versed in typescript to make the necessary code changes.

Related issue(s)

Resolves #275

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@pvdbosch pvdbosch changed the title Clone OpenAPI input schemas before transforming them fix: clone input schemas before transforming them Aug 14, 2025
@sonarqubecloud
Copy link

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.

There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Parsing fails for schema that's referenced multiple times

1 participant