|
@ -10,6 +10,7 @@ from fastapi._compat import ( |
|
|
with_info_plain_validator_function, |
|
|
with_info_plain_validator_function, |
|
|
) |
|
|
) |
|
|
from fastapi.logger import logger |
|
|
from fastapi.logger import logger |
|
|
|
|
|
from fastapi.openapi.constants import TypeValue |
|
|
from pydantic import AnyUrl, BaseModel, Field |
|
|
from pydantic import AnyUrl, BaseModel, Field |
|
|
from typing_extensions import Annotated, Literal, TypedDict |
|
|
from typing_extensions import Annotated, Literal, TypedDict |
|
|
from typing_extensions import deprecated as typing_deprecated |
|
|
from typing_extensions import deprecated as typing_deprecated |
|
@ -145,7 +146,7 @@ class Schema(BaseModelWithConfig): |
|
|
dependentSchemas: Optional[Dict[str, "SchemaOrBool"]] = None |
|
|
dependentSchemas: Optional[Dict[str, "SchemaOrBool"]] = None |
|
|
prefixItems: Optional[List["SchemaOrBool"]] = None |
|
|
prefixItems: Optional[List["SchemaOrBool"]] = None |
|
|
# TODO: uncomment and remove below when deprecating Pydantic v1 |
|
|
# TODO: uncomment and remove below when deprecating Pydantic v1 |
|
|
# It generales a list of schemas for tuples, before prefixItems was available |
|
|
# It generates a list of schemas for tuples, before prefixItems was available |
|
|
# items: Optional["SchemaOrBool"] = None |
|
|
# items: Optional["SchemaOrBool"] = None |
|
|
items: Optional[Union["SchemaOrBool", List["SchemaOrBool"]]] = None |
|
|
items: Optional[Union["SchemaOrBool", List["SchemaOrBool"]]] = None |
|
|
contains: Optional["SchemaOrBool"] = None |
|
|
contains: Optional["SchemaOrBool"] = None |
|
@ -157,7 +158,7 @@ class Schema(BaseModelWithConfig): |
|
|
unevaluatedProperties: Optional["SchemaOrBool"] = None |
|
|
unevaluatedProperties: Optional["SchemaOrBool"] = None |
|
|
# Ref: JSON Schema Validation 2020-12: https://json-schema.org/draft/2020-12/json-schema-validation.html#name-a-vocabulary-for-structural |
|
|
# Ref: JSON Schema Validation 2020-12: https://json-schema.org/draft/2020-12/json-schema-validation.html#name-a-vocabulary-for-structural |
|
|
# A Vocabulary for Structural Validation |
|
|
# A Vocabulary for Structural Validation |
|
|
type: Optional[str] = None |
|
|
type: Optional[Union[TypeValue, list[TypeValue]]] = None |
|
|
enum: Optional[List[Any]] = None |
|
|
enum: Optional[List[Any]] = None |
|
|
const: Optional[Any] = None |
|
|
const: Optional[Any] = None |
|
|
multipleOf: Optional[float] = Field(default=None, gt=0) |
|
|
multipleOf: Optional[float] = Field(default=None, gt=0) |
|
|