From 3fa359d2fd17e5d33ce34b1b5231db89507de385 Mon Sep 17 00:00:00 2001 From: Diogo Dutra Date: Mon, 19 Feb 2018 12:02:33 -0300 Subject: [PATCH] fixing the 'Definitions Object' validation. According to the specification 'These data types can be primitives, arrays or models'. see: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#definitionsObject --- swagger_spec_validator/validator20.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swagger_spec_validator/validator20.py b/swagger_spec_validator/validator20.py index 673eb58..d2c8425 100644 --- a/swagger_spec_validator/validator20.py +++ b/swagger_spec_validator/validator20.py @@ -194,7 +194,7 @@ def validate_definition(definition, deref, def_name=None): if 'allOf' in definition: for inner_definition in definition['allOf']: validate_definition(inner_definition, deref) - else: + elif isinstance(definition, dict): required = definition.get('required', []) props = definition.get('properties', {}).keys() extra_props = list(set(required) - set(props))