-
Notifications
You must be signed in to change notification settings - Fork 11
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
Question: Circular References in the scheme #55
Comments
I haven't tested it, but I think it should work. Though it's possible that there is some bug. |
@florintene It seems that circular refs are not supported, as per AJV here: https://ajv.js.org/security.html#circular-references-in-javascript-objects. I'll update the readme. |
Thank you very much @WaleedAshraf. Circular references are always a problem but i'm surprise that AJV doesn't support them. There are options out there that can help in a combination with AJV. Used the bundle:
and then AJV can compile successfully the schema. Not to mention that there is always the option to review the schema and drop the circular references - although that is not always possible. Anyway, hope the above info might help others. Thank you ;) |
I see your point. I think it's possible the way you suggested, though I'd prefer if it's done within asyncapi/parser-js as it handles the parsing. An optional parameter can be passed to remove circular references. It's already using json-schema-ref-parser. I suggest opening an issue there. Another way you can try is to parse the schema with asyncapi/parser-js then remove the circular refs using json-schema-ref-parser and then use asyncpi-validator. This may work, but I haven't tested it yet. |
Yes, is something to explore. Anyway, i'll try to have a look and let you know. |
Hi,
I do have a question, as I couldn't find in the docs, if circular references are supported by the asyncapi-validator ?
Currently, for a definition that has circular references the validation fails with:
Thank you,
The text was updated successfully, but these errors were encountered: