Skip to content

Commit c4c5163

Browse files
committed
Rename schema validate to obj_validate
1 parent f414b18 commit c4c5163

File tree

4 files changed

+78
-78
lines changed

4 files changed

+78
-78
lines changed

openapi_core/schema/media_types/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def unmarshal(self, value, custom_formatters=None):
4747
raise InvalidMediaTypeValue(exc)
4848

4949
try:
50-
return self.schema.validate(
50+
return self.schema.obj_validate(
5151
unmarshalled, custom_formatters=custom_formatters)
5252
except OpenAPISchemaError as exc:
5353
raise InvalidMediaTypeValue(exc)

openapi_core/schema/parameters/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def unmarshal(self, value, custom_formatters=None):
123123
raise InvalidParameterValue(self.name, exc)
124124

125125
try:
126-
return self.schema.validate(
126+
return self.schema.obj_validate(
127127
unmarshalled, custom_formatters=custom_formatters)
128128
except OpenAPISchemaError as exc:
129129
raise InvalidParameterValue(self.name, exc)

openapi_core/schema/schemas/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def default(x, **kw):
406406

407407
return defaultdict(lambda: default, mapping)
408408

409-
def validate(self, value, custom_formatters=None):
409+
def obj_validate(self, value, custom_formatters=None):
410410
if value is None:
411411
if not self.nullable:
412412
raise InvalidSchemaValue("Null value for non-nullable schema of type {type}", value, self.type)
@@ -453,7 +453,7 @@ def _validate_collection(self, value, custom_formatters=None):
453453
if self.unique_items and len(set(value)) != len(value):
454454
raise OpenAPISchemaError("Value may not contain duplicate items")
455455

456-
f = functools.partial(self.items.validate,
456+
f = functools.partial(self.items.obj_validate,
457457
custom_formatters=custom_formatters)
458458
return list(map(f, value))
459459

@@ -602,7 +602,7 @@ def _validate_properties(self, value, one_of_schema=None,
602602
if self.additional_properties is not True:
603603
for prop_name in extra_props:
604604
prop_value = value[prop_name]
605-
self.additional_properties.validate(
605+
self.additional_properties.obj_validate(
606606
prop_value, custom_formatters=custom_formatters)
607607

608608
for prop_name, prop in iteritems(all_props):
@@ -615,7 +615,7 @@ def _validate_properties(self, value, one_of_schema=None,
615615
continue
616616
prop_value = prop.default
617617
try:
618-
prop.validate(prop_value, custom_formatters=custom_formatters)
618+
prop.obj_validate(prop_value, custom_formatters=custom_formatters)
619619
except OpenAPISchemaError as exc:
620620
raise InvalidSchemaProperty(prop_name, original_exception=exc)
621621

0 commit comments

Comments
 (0)