Skip to content

Fix: infinite recursion in buildEmptyJsonBody #4547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

pooja-bruno
Copy link
Collaborator

@pooja-bruno pooja-bruno commented Apr 23, 2025

Description

Fixed a issue in the OpenAPI to Bruno converter where circular references in JSON schemas would cause a "Maximum callstack size exceeded" error. Added a visited Map parameter to the buildEmptyJsonBody function to track already processed schemas and prevent infinite recursion when handling complex nested structures. This fix ensures that OpenAPI specifications with circular references can be properly imported without crashing.

JIRA

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

@pull-request-size pull-request-size bot added size/L and removed size/S labels Apr 25, 2025
Copy link
Collaborator

@maintainer-bruno maintainer-bruno left a comment

Choose a reason for hiding this comment

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

Please address the comments on file packages/bruno-converters/tests/openapi/openapi-circular-references.spec.js

@pooja-bruno pooja-bruno force-pushed the fix/infinite-recursion-in-buildEmptyJsonBody branch from 36978c3 to df16ce7 Compare May 21, 2025 06:40
@pooja-bruno pooja-bruno deleted the fix/infinite-recursion-in-buildEmptyJsonBody branch May 21, 2025 08:49
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.

2 participants