@@ -67,6 +67,25 @@ if you want to disambiguate the expected schema version, import and use ``OAS31V
6767
6868 validate({" name" : " John" , " age" : 23 }, schema, cls = OAS31Validator)
6969
70+ The OpenAPI 3.1 base dialect URI is registered for
71+ ``jsonschema.validators.validator_for `` resolution.
72+ If your schema declares
73+ ``"$schema": "https://spec.openapis.org/oas/3.1/dialect/base" ``,
74+ ``validator_for `` resolves directly to ``OAS31Validator `` without
75+ unresolved-metaschema fallback warnings.
76+
77+ .. code-block :: python
78+
79+ from jsonschema.validators import validator_for
80+
81+ from openapi_schema_validator import OAS31Validator
82+
83+ schema = {
84+ " $schema" : " https://spec.openapis.org/oas/3.1/dialect/base" ,
85+ " type" : " object" ,
86+ }
87+ assert validator_for(schema) is OAS31Validator
88+
7089 For OpenAPI 3.2, use ``OAS32Validator `` (behaves identically to ``OAS31Validator ``, since 3.2 uses the same JSON Schema dialect).
7190
7291In order to validate OpenAPI 3.0 schema, import and use ``OAS30Validator `` instead of ``OAS31Validator ``.
@@ -193,7 +212,8 @@ Example usage:
193212
194213.. code-block :: python
195214
196- from openapi_schema_validator import OAS30Validator, OAS30StrictValidator
215+ from openapi_schema_validator import OAS30StrictValidator
216+ from openapi_schema_validator import OAS30Validator
197217
198218 # Pragmatic (default) - accepts bytes for binary format
199219 validator = OAS30Validator({" type" : " string" , " format" : " binary" })
0 commit comments