When I make a cyclic reference in swagger, and try to open the documentation in the developer menu, an error occurs on the page. In the browser console I see the following:
Uncaught (in promise) RangeError: Maximum call stack size exceeded
at vendor_bcf6c535bcee95c12bb0.js:1
at r (vendor_bcf6c535bcee95c12bb0.js:1)
at n (main_ab5e630d3b1e9decbecb.js:1)
at i (main_ab5e630d3b1e9decbecb.js:1)
at i (main_ab5e630d3b1e9decbecb.js:1)
at main_ab5e630d3b1e9decbecb.js:1
at main_ab5e630d3b1e9decbecb.js:1
at vendor_bcf6c535bcee95c12bb0.js:1
at r (vendor_bcf6c535bcee95c12bb0.js:1)
at n (main_ab5e630d3b1e9decbecb.js:1)
the piece of swagger with problem is this, where there is the cyclic reference:
"Message": {
"properties": {
"code": {
"type": "string"
},
"detail": {
"type": "string"
},
"relatedMessage": {
"items": {
"$ref": "#/definitions/Message"
},
"type": "array"
},
"title": {
"type": "string"
},
"type": {
"enum": [
"INFO",
"WARNING",
"ERROR"
],
"type": "string"
}
},
"type": "object"
}
Installed Version: 4.2.9.3
I searched changelog and found no known bugs with this problem.
Removing the reference
"$ref": "#/definitions/Message"
opens normally.