File: format.rst

package info (click to toggle)
python-openapi-schema-validator 0.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 372 kB
  • sloc: python: 1,186; makefile: 46
file content (14 lines) | stat: -rw-r--r-- 358 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Format check
============

You can check format for predefined OAS primitive types

.. code-block:: python

   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'