|
|
@ -2,6 +2,7 @@ import warnings |
|
|
|
from enum import Enum |
|
|
|
from typing import Any, Callable, Dict, List, Optional, Sequence, Union |
|
|
|
|
|
|
|
from annotated_types import SupportsGe, SupportsGt, SupportsLe, SupportsLt |
|
|
|
from fastapi.openapi.models import Example |
|
|
|
from pydantic.fields import FieldInfo |
|
|
|
from typing_extensions import Annotated, deprecated |
|
|
@ -39,10 +40,10 @@ class Param(FieldInfo): |
|
|
|
serialization_alias: Union[str, None] = None, |
|
|
|
title: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
gt: Optional[float] = None, |
|
|
|
ge: Optional[float] = None, |
|
|
|
lt: Optional[float] = None, |
|
|
|
le: Optional[float] = None, |
|
|
|
gt: Optional[SupportsGt] = None, |
|
|
|
ge: Optional[SupportsGe] = None, |
|
|
|
lt: Optional[SupportsLt] = None, |
|
|
|
le: Optional[SupportsLe] = None, |
|
|
|
min_length: Optional[int] = None, |
|
|
|
max_length: Optional[int] = None, |
|
|
|
pattern: Optional[str] = None, |
|
|
@ -153,10 +154,10 @@ class Path(Param): |
|
|
|
serialization_alias: Union[str, None] = None, |
|
|
|
title: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
gt: Optional[float] = None, |
|
|
|
ge: Optional[float] = None, |
|
|
|
lt: Optional[float] = None, |
|
|
|
le: Optional[float] = None, |
|
|
|
gt: Optional[SupportsGt] = None, |
|
|
|
ge: Optional[SupportsGe] = None, |
|
|
|
lt: Optional[SupportsLt] = None, |
|
|
|
le: Optional[SupportsLe] = None, |
|
|
|
min_length: Optional[int] = None, |
|
|
|
max_length: Optional[int] = None, |
|
|
|
pattern: Optional[str] = None, |
|
|
@ -239,10 +240,10 @@ class Query(Param): |
|
|
|
serialization_alias: Union[str, None] = None, |
|
|
|
title: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
gt: Optional[float] = None, |
|
|
|
ge: Optional[float] = None, |
|
|
|
lt: Optional[float] = None, |
|
|
|
le: Optional[float] = None, |
|
|
|
gt: Optional[SupportsGt] = None, |
|
|
|
ge: Optional[SupportsGe] = None, |
|
|
|
lt: Optional[SupportsLt] = None, |
|
|
|
le: Optional[SupportsLe] = None, |
|
|
|
min_length: Optional[int] = None, |
|
|
|
max_length: Optional[int] = None, |
|
|
|
pattern: Optional[str] = None, |
|
|
@ -324,10 +325,10 @@ class Header(Param): |
|
|
|
convert_underscores: bool = True, |
|
|
|
title: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
gt: Optional[float] = None, |
|
|
|
ge: Optional[float] = None, |
|
|
|
lt: Optional[float] = None, |
|
|
|
le: Optional[float] = None, |
|
|
|
gt: Optional[SupportsGt] = None, |
|
|
|
ge: Optional[SupportsGe] = None, |
|
|
|
lt: Optional[SupportsLt] = None, |
|
|
|
le: Optional[SupportsLe] = None, |
|
|
|
min_length: Optional[int] = None, |
|
|
|
max_length: Optional[int] = None, |
|
|
|
pattern: Optional[str] = None, |
|
|
@ -409,10 +410,10 @@ class Cookie(Param): |
|
|
|
serialization_alias: Union[str, None] = None, |
|
|
|
title: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
gt: Optional[float] = None, |
|
|
|
ge: Optional[float] = None, |
|
|
|
lt: Optional[float] = None, |
|
|
|
le: Optional[float] = None, |
|
|
|
gt: Optional[SupportsGt] = None, |
|
|
|
ge: Optional[SupportsGe] = None, |
|
|
|
lt: Optional[SupportsLt] = None, |
|
|
|
le: Optional[SupportsLe] = None, |
|
|
|
min_length: Optional[int] = None, |
|
|
|
max_length: Optional[int] = None, |
|
|
|
pattern: Optional[str] = None, |
|
|
@ -493,10 +494,10 @@ class Body(FieldInfo): |
|
|
|
serialization_alias: Union[str, None] = None, |
|
|
|
title: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
gt: Optional[float] = None, |
|
|
|
ge: Optional[float] = None, |
|
|
|
lt: Optional[float] = None, |
|
|
|
le: Optional[float] = None, |
|
|
|
gt: Optional[SupportsGt] = None, |
|
|
|
ge: Optional[SupportsGe] = None, |
|
|
|
lt: Optional[SupportsLt] = None, |
|
|
|
le: Optional[SupportsLe] = None, |
|
|
|
min_length: Optional[int] = None, |
|
|
|
max_length: Optional[int] = None, |
|
|
|
pattern: Optional[str] = None, |
|
|
@ -609,10 +610,10 @@ class Form(Body): |
|
|
|
serialization_alias: Union[str, None] = None, |
|
|
|
title: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
gt: Optional[float] = None, |
|
|
|
ge: Optional[float] = None, |
|
|
|
lt: Optional[float] = None, |
|
|
|
le: Optional[float] = None, |
|
|
|
gt: Optional[SupportsGt] = None, |
|
|
|
ge: Optional[SupportsGe] = None, |
|
|
|
lt: Optional[SupportsLt] = None, |
|
|
|
le: Optional[SupportsLe] = None, |
|
|
|
min_length: Optional[int] = None, |
|
|
|
max_length: Optional[int] = None, |
|
|
|
pattern: Optional[str] = None, |
|
|
@ -693,10 +694,10 @@ class File(Form): |
|
|
|
serialization_alias: Union[str, None] = None, |
|
|
|
title: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
gt: Optional[float] = None, |
|
|
|
ge: Optional[float] = None, |
|
|
|
lt: Optional[float] = None, |
|
|
|
le: Optional[float] = None, |
|
|
|
gt: Optional[SupportsGt] = None, |
|
|
|
ge: Optional[SupportsGe] = None, |
|
|
|
lt: Optional[SupportsLt] = None, |
|
|
|
le: Optional[SupportsLe] = None, |
|
|
|
min_length: Optional[int] = None, |
|
|
|
max_length: Optional[int] = None, |
|
|
|
pattern: Optional[str] = None, |
|
|
|