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

$ref not found and Yaml Extension #8

Open
avelinob opened this issue Feb 12, 2019 · 0 comments
Open

$ref not found and Yaml Extension #8

avelinob opened this issue Feb 12, 2019 · 0 comments

Comments

@avelinob
Copy link

I get this error:

Traceback` (most recent call last):
  File "swagger_to_uml.py", line 380, in <module>
    sw = Swagger.from_file(input_file_name)
  File "swagger_to_uml.py", line 367, in from_file
    return Swagger.from_dict(loader(fd))
  File "swagger_to_uml.py", line 357, in from_dict
    definitions = [Definition.from_dict(name, definition) for name, definition in d.get('definitions',{}).items()]
  File "swagger_to_uml.py", line 357, in <listcomp>
    definitions = [Definition.from_dict(name, definition) for name, definition in d.get('definitions',{}).items()]
  File "swagger_to_uml.py", line 197, in from_dict
    required=property_name in d.get('required', [])
  File "swagger_to_uml.py", line 103, in from_dict
    items = resolve_ref(type_dict['items']['$ref'])
KeyError: '$ref'

Fixed:

c103
<                 items = resolve_ref(type_dict['items']['$ref']) if '$ref' in type_dict['items'] else None
c364
<         if filename.endswith('.yml') or filename.endswith('.yaml'):

Sorry cant do pull req due to ... policy

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