We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49ad680 commit 3432234Copy full SHA for 3432234
openapi_schema_validator/shortcuts.py
@@ -15,11 +15,12 @@ def validate(
15
*args: Any,
16
**kwargs: Any
17
) -> None:
18
+ """
19
+ Validate an instance against a given schema using the specified validator class.
20
21
schema_dict = cast(dict[str, Any], schema)
22
cls.check_schema(schema_dict)
23
validator = cls(schema_dict, *args, **kwargs)
- errors = list(validator.evolve(schema=schema_dict).iter_errors(instance))
- if errors:
- error = best_match(errors)
24
- error.message = f"Validation failed: {error.message}"
+ error = best_match(validator.evolve(schema=schema_dict).iter_errors(instance))
25
+ if error is not None:
26
raise error
0 commit comments