cyprieng / swagger-parser

Give useful informations about your swagger files
MIT License
62 stars 59 forks source link

AttributeError: 'NoneType' object has no attribute 'keys' #32

Open crudo10 opened 7 years ago

crudo10 commented 7 years ago

Function _get_example_from_properties in swagger_parser.py contains the following code:

properties = local_spec.get('properties')
required = local_spec.get('required', properties.keys())

which throws

AttributeError: 'NoneType' object has no attribute 'keys'

error if there is no "properties" property in the object. I know it is weird to have an object without properties but I do have these in our Swagger due to some stubbed/not implemented features.