Skip to content

$ref not found and Yaml Extension #8

@avelinob

Description

@avelinob

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions