Skip to content
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

This API is valid, but it cannot be shown because it contains circular references #392

Open
daveneeley opened this issue Aug 29, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@daveneeley
Copy link

Using the apitools.dev online swagger parser, to parse the REST/openapiv3.json spec, we receive the following:

This API is valid, but it cannot be shown because it contains circular references

TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'Object'
    |     property 'properties' -> object with constructor 'Object'
    |     property 'children' -> object with constructor 'Object'
    --- property 'items' closes the circle
    at JSON.stringify (<anonymous>)
    at toText (https://apitools.dev/swagger-parser/online/js/bundle.min.js:29:40049)
    at editors.addResult (https://apitools.dev/swagger-parser/online/js/bundle.min.js:29:41185)
    at editors.showResult (https://apitools.dev/swagger-parser/online/js/bundle.min.js:29:40466)
    at https://apitools.dev/swagger-parser/online/js/bundle.min.js:29:44991
    at Array.forEach (<anonymous>)
    at https://apitools.dev/swagger-parser/online/js/bundle.min.js:29:44971

If we disable following circular references in the tool, we get

Circular $ref pointer found at https://raw.githubusercontent.com/PagerDuty/api-schema/main/reference/REST/openapiv3.json#/components/schemas/MatchPredicate/properties/children/items

Error: Circular $ref pointer found at https://raw.githubusercontent.com/PagerDuty/api-schema/main/reference/REST/openapiv3.json#/components/schemas/MatchPredicate/properties/children/items
    at o (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:95564)
    at https://apitools.dev/swagger-parser/online/js/bundle.min.js:29:45042

ReferenceError: Circular $ref pointer found at https://raw.githubusercontent.com/PagerDuty/api-schema/main/reference/REST/openapiv3.json#/components/schemas/MatchPredicate/properties/children/items
    at Function.o [as reference] (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:95564)
    at foundCircularReference (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:14971)
    at dereference$Ref (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:14667)
    at crawl (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:14259)
    at crawl (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:14354)
    at crawl (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:14354)
    at dereference$Ref (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:14744)
    at crawl (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:14259)
    at crawl (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:14354)
    at dereference$Ref (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:14744)

Related: microsoft/kiota#3213

@gregvinyard
Copy link

gregvinyard commented Jul 25, 2024

Here is the list of issues I detected in reference/REST/openapiv3.json , including the circular reference.

Line 5945: required field id is not defined in properties
Line 5946: required field type is not defined in properties
Line 6222: required field id is not defined in properties
Line 6223: required field type is not defined in properties
Line 6320: required field id is not defined in properties
Line 6321: required field type is not defined in properties
Line 8004: required field name is not defined in properties
Line 8005: required field src is not defined in properties
Line 8201: object contains required fields but no properties
Line 11229: required field type is not defined in properties
Line 11443: required field value is not defined in properties
Line 11496: required field value is not defined in properties
Line 13482: infinite circular reference detected: MatchPredicate: MatchPredicate -> MatchPredicate [13482:25]
Line 15343: object contains required fields but no properties
Line 30128: required field id is not defined in properties
Line 38703: object contains required fields but no properties
Line 46754: required field post_update is not defined in properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants