Skip to content

Latest commit

 

History

History
16 lines (10 loc) · 406 Bytes

File metadata and controls

16 lines (10 loc) · 406 Bytes

Format check

You can check format for predefined OAS primitive types

from openapi_schema_validator import oas31_format_checker

validate({"name": "John", "birth-date": "-12"}, schema, format_checker=oas31_format_checker)

Traceback (most recent call last):
    ...
ValidationError: '-12' is not a 'date'

For OpenAPI 3.2, use oas32_format_checker.