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

Handling allOf for Dog and Cat types of Pet #9

Open
cfaurer opened this issue Mar 21, 2019 · 0 comments
Open

Handling allOf for Dog and Cat types of Pet #9

cfaurer opened this issue Mar 21, 2019 · 0 comments

Comments

@cfaurer
Copy link

cfaurer commented Mar 21, 2019

Extended Pet example to include Cat and Dog using allOf example from here: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md

Get the following error:

`python swagger_to_uml.py swagger.json > swagger.puml
required key "type" not found in dictionary {"description": "A representation of a cat", "allOf": [{"$ref": "#/definitions/Pet"}, {"type": "object", "properties": {"huntingSkill": {"type": "string", "description": "The measured skill for hunting", "default": "lazy", "enum": ["clueless", "lazy", "adventurous", "aggressive"]}}, "required": ["huntingSkill"]}]}
Traceback (most recent call last):
File "swagger_to_uml.py", line 380, in
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
definitions = [Definition.from_dict(name, definition) for name, definition in d.get('definitions',{}).items()]
File "swagger_to_uml.py", line 204, in from_dict
type=d['type'],
KeyError: 'type'

Modified swagger attached

swagger.json.txt

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