From 42923990edb173ef671271d914f3ba660a63d005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Ba=C5=A1ista?= Date: Fri, 9 Feb 2018 19:48:52 +0100 Subject: [PATCH] Use a more generic test for path item object's operations Get the list of allowed operations from openapi_spec_validator: https://github.com/p1c2u/openapi-spec-validator/blob/b2e439aa79c7cde932f9926f1ae124556924b10d/openapi_spec_validator/validators.py#L157 --- openapi_core/operations.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openapi_core/operations.py b/openapi_core/operations.py index 3e82ca37..bf9d520b 100644 --- a/openapi_core/operations.py +++ b/openapi_core/operations.py @@ -4,6 +4,7 @@ from functools import lru_cache from six import iteritems +from openapi_spec_validator.validators import PathItemValidator from openapi_core.exceptions import InvalidResponse from openapi_core.parameters import ParametersGenerator @@ -56,7 +57,7 @@ def __init__(self, dereferencer, schemas_registry): def generate(self, path_name, path): path_deref = self.dereferencer.dereference(path) for http_method, operation in iteritems(path_deref): - if http_method.startswith('x-') or http_method == 'parameters': + if http_method not in PathItemValidator.OPERATIONS: continue operation_deref = self.dereferencer.dereference(operation)