Closed christianklotz closed 1 year ago
I looked at the issues earlier but somehow missed #523 which looks very similar.
Dup of #523
I disagree with closing this as a duplicate:
TypeError: Converting circular structure to JSON
vs RangeError: Maximum call stack size exceeded
.Having said that, the minimal schema given here is confusing to think about. Unlike the other issue, this one passes validation, but it still seems invalid because I can't see how to construct a finite valid object according to the schema:
I have been trying to generate Typescript types from the Amazon State Language JSON Schema which leads to the following error:
As far as I can tell this is a circular reference where the referenced definition itself is a
oneOf
which in turn contains the definition with the$ref
.Removing all unnecessary layers and definitions leaves the following schema.
Reduced schema
Reduced schema without
oneOf
in referenced typeThe moment the referenced definition is an object, no longer a
oneOf
, the circular reference gets resolved correctly.I'd be happy to take a look myself but would appreciate a few suggestions on where to look, possible routes.