- edited description
Are specs with circular references supported?
Hey there, thank you for your work on this library!
I am getting ReferenceErrors when I try to compare swagger files with circular references.
{ VError: ReferenceError: Circular $ref pointer found at /XXX/openapidiff-atlassian/#/definitions/File/properties/absoluteFile
at Object.<anonymous> (/XXX/openapidiff-atlassian/node_modules/openapi-diff/dist/openapi-diff/spec-differ/diff-finder/json-schema-diff.js:26:15)
at Generator.throw (<anonymous>)
at rejected (/XXX/openapidiff-atlassian/node_modules/openapi-diff/dist/openapi-diff/spec-differ/diff-finder/json-schema-diff.js:5:65)
jse_shortmsg:
'ReferenceError: Circular $ref pointer found at /XXX/openapidiff-atlassian/#/definitions/File/properties/absoluteFile',
jse_info: {},
message:
'ReferenceError: Circular $ref pointer found at /XXX/openapidiff-atlassian/#/definitions/File/properties/absoluteFile',
code: 'OPENAPI_DIFF_DIFF_ERROR' }
Looks like circular references are ignored during parsing step but diff step throws this error when it encounters them.
So my question is: does this tool support specs with circular references or is this intentional?
Cheers
Comments (5)
-
reporter -
@Halil Can Salis the reason you are getting reference errors is that we do not support circular references at the moment. This is because one of the dependencies of this tool called json-schema-diff does not yet support circular references. My team is working on json-schema-diff however our current focus is on adding support for keywords such as
not
,anyOf
andoneOf
so I’m not sure when we will get around to adding support for circular references.Our docs didn’t mention that we do not support circular references so I’ve updated them to make this clear.
Thanks for letting us know about this and happy to hear about any other feedback/suggestions/feature requests you might have!
-
- changed status to closed
-
Issue
#5was marked as a duplicate of this issue. -
Updates on the implementation of this feature will be made here:
https://bitbucket.org/atlassian/openapi-diff/issues/6/add-support-for-circular-references - Log in to comment