Skip to content
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

Editor freezes when having circular $ref in schemas #4661

Open
alpalex opened this issue Dec 13, 2023 · 0 comments
Open

Editor freezes when having circular $ref in schemas #4661

alpalex opened this issue Dec 13, 2023 · 0 comments

Comments

@alpalex
Copy link

alpalex commented Dec 13, 2023

Q&A (please complete the following information)

  • OS: [e.g. macOS]
  • Browser: [e.g. chrome, safari]
  • Version: [e.g. 22]
  • Method of installation: don't remember, i think i cloned the repo and used npm from there on
  • Swagger-Editor version: 174eb07
  • Swagger/OpenAPI version: OpenAPI 3.0.3

Describe the bug you're encountering

Tab freezes

To reproduce...

Steps to reproduce the behavior:
use following OpenAPI specification:

components:
  schemas:
    xyz:
      type: array
      items:          
        $ref: '#/components/schemas/xyz'

Additional context or thoughts

This circular reference is most of the time a user mistake. (But i guess this could be an actual thing the user wants to do too!!!)
This is especially nasty because it is complicated to gain access to the definition again:

  1. wait until browser notifies you the page is running slow and offers you a "stop" button to stop javascript execution
  2. use dev console to remove the circular ref. Example:
localStorage.setItem('swagger-editor-content', localStorage.getItem('swagger-editor-content').replaceAll('#/components/schemas/challenge', ''))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant