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

problem parsing azure netapp swagger circular reference #74

Open
MarioRuiz opened this issue Jun 29, 2023 · 1 comment
Open

problem parsing azure netapp swagger circular reference #74

MarioRuiz opened this issue Jun 29, 2023 · 1 comment

Comments

@MarioRuiz
Copy link

When parsing https://github.com/Azure/azure-rest-api-specs/blob/main/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/netapp.json I get
Error: key not found: "ErrorDetail"
backtrace:

/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/pointer.rb:11:in `fetch'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/pointer.rb:11:in `block in resolve'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/pointer.rb:10:in `each'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/pointer.rb:10:in `reduce'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/pointer.rb:10:in `resolve'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:68:in `expand_pointer'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:41:in `expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:20:in `deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:24:in `block in deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `each'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `reduce'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:24:in `block in deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `each'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `reduce'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:24:in `block in deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `each'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `reduce'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:24:in `block in deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `each'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `reduce'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:24:in `block in deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `each'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `reduce'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:24:in `block in deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `each'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `reduce'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:24:in `block in deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `each'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `reduce'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:24:in `block in deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `each'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `reduce'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:24:in `block in deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `each'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `reduce'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:24:in `block in deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `each'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `reduce'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:24:in `block in deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `each'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `reduce'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:23:in `deeply_expand_refs'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:14:in `resolve'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/parser.rb:5:in `resolve'
/Users/marioruizsanchez/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/oas_parser-0.25.4/lib/oas_parser/definition.rb:12:in `resolve'
@MarioRuiz
Copy link
Author

I think this is because of circular references:

"default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "../../../../../common-types/resource-management/v4/types.json#/definitions/ErrorResponse"
            }
          }

might be the common type ErrorDetails does reference itself "$ref": "#/definitions/ErrorDetail"

@MarioRuiz MarioRuiz changed the title problem parsing azure netapp swagger problem parsing azure netapp swagger circular reference Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant