unrecoverable error in case of recursion in asyncapi document
Description As described in this issue https://github.com/asyncapi/studio/issues/771
when a document has got recursion in it
the rendering crashes due to too many recursion.
This causes the app to go into unrecoverable error.
Steps to reproduce:
- go to https://studio.asyncapi.com
- paste
asyncapi: 3.0.0
info:
title: Account Service
version: 1.0.0
description: This service is in charge of processing user signups
channels:
user/signedup:
address: user/signedup
messages:
subscribe.message:
$ref: '#/components/messages/TradeMessageServer'
components:
messages:
TradeMessageServer:
name: Trade Message (server)
title: Trade Message (server)
description: A message containing trade data
x-something:
$ref: '#/components/messages/TradeMessageServer' #RECURSION IS HAPPENING HERE !!!
the error in console
Now Since studio fetches the document from localstorage before loading. Even if you reload the site it keeps on crashing again and again. Only way to recover is to clear the localstorage and start again with all the progress lost.
Expected result Application should not crash into an unrecoverable state.
The problem is in the recursion found in this function which doesnt have a recursion limit
Related Issues: https://github.com/asyncapi/studio/issues/771