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

allOf not handled in Items #18

Open
TOTOleHero opened this issue Dec 19, 2020 · 0 comments
Open

allOf not handled in Items #18

TOTOleHero opened this issue Dec 19, 2020 · 0 comments

Comments

@TOTOleHero
Copy link

TOTOleHero commented Dec 19, 2020

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

TOTOleHero added a commit to TOTOleHero/swagger_to_uml that referenced this issue Dec 20, 2020
TOTOleHero added a commit to TOTOleHero/swagger_to_uml that referenced this issue Dec 20, 2020
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