Skip to content

Commit 48dba2c

Browse files
committed
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
1 parent 49c2330 commit 48dba2c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

openapi_core/operations.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from functools import lru_cache
55

66
from six import iteritems
7+
from openapi_spec_validator.validators import PathItemValidator
78

89
from openapi_core.exceptions import InvalidResponse
910
from openapi_core.parameters import ParametersGenerator
@@ -56,7 +57,7 @@ def __init__(self, dereferencer, schemas_registry):
5657
def generate(self, path_name, path):
5758
path_deref = self.dereferencer.dereference(path)
5859
for http_method, operation in iteritems(path_deref):
59-
if http_method.startswith('x-') or http_method == 'parameters':
60+
if http_method not in PathItemValidator.OPERATIONS:
6061
continue
6162

6263
operation_deref = self.dereferencer.dereference(operation)

0 commit comments

Comments
 (0)