Merge pull request #14 from pbasista/bugfix/path-item-operations

Use a more generic test for path item object's operations
This commit is contained in:
A 2018-02-28 12:14:13 +00:00 committed by GitHub
commit a9d17601b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@ import logging
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 @@ class OperationsGenerator(object):
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)