Skip to content

allOf not handled in Items #18

@TOTOleHero

Description

@TOTOleHero

Hello,

I need to define property UnitGameSystem.profiles with an array of multiple type of object ProfileXXX whish are inherited of object Profile

...
  UnitGameSystem:
    properties:
      id:
        type: string
      name:
        type: string
      profiles:
        items:
          allOf:
            - $ref: '#/definitions/ProfileAOS4'
            - $ref: '#/definitions/ProfileWFB9'
            - $ref: '#/definitions/ProfileWFB12'
            - $ref: '#/definitions/ProfileWHQ'
            - $ref: '#/definitions/ProfileT9A12'
        type: array
...

I have an error for this definition

d:\PROJECTS\swagger_to_uml>python swagger_to_uml.py fantasy-battle-db.swagger.json > fantasy-battle-db.puml
Traceback (most recent call last):
  File "d:\PROJECTS\swagger_to_uml\swagger_to_uml.py", line 380, in <module>
    sw = Swagger.from_file(input_file_name)
  File "d:\PROJECTS\swagger_to_uml\swagger_to_uml.py", line 367, in from_file
    return Swagger.from_dict(loader(fd))
  File "d:\PROJECTS\swagger_to_uml\swagger_to_uml.py", line 356, in from_dict
    definitions = [Definition.from_dict(name, definition) for name, definition in d.get('definitions',{}).items()]
  File "d:\PROJECTS\swagger_to_uml\swagger_to_uml.py", line 356, in <listcomp>
    definitions = [Definition.from_dict(name, definition) for name, definition in d.get('definitions',{}).items()]
  File "d:\PROJECTS\swagger_to_uml\swagger_to_uml.py", line 193, in from_dict
    properties.append(Property.from_dict(
  File "d:\PROJECTS\swagger_to_uml\swagger_to_uml.py", line 102, in from_dict
    items = resolve_ref(type_dict['items']['$ref'])
KeyError: '$ref'

full json is : fantasy-battle-db.swagger.json.txt

Thank's you

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