- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 55 for BaseModel (0.15 seconds)
-
scripts/people.py
edges: list[DiscussionsEdge] class DiscussionsRepository(BaseModel): discussions: Discussions class DiscussionsResponseData(BaseModel): repository: DiscussionsRepository class DiscussionsResponse(BaseModel): data: DiscussionsResponseData class Settings(BaseSettings): github_token: SecretStr github_repository: str httpx_timeout: int = 30
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Mon Mar 23 13:51:24 GMT 2026 - 15K bytes - Click Count (0) -
fastapi/_compat/v2.py
def create_body_model( *, fields: Sequence[ModelField], model_name: str ) -> type[BaseModel]: field_params = {f.name: (f.field_info.annotation, f.field_info) for f in fields} BodyModel: type[BaseModel] = create_model(model_name, **field_params) # type: ignore[call-overload] return BodyModel def get_model_fields(model: type[BaseModel]) -> list[ModelField]: model_fields: list[ModelField] = []
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 15 11:44:39 GMT 2026 - 16.7K bytes - Click Count (0) -
docs/zh/docs/tutorial/body.md
由于不推荐,在使用 `GET` 时,Swagger UI 的交互式文档不会显示请求体的文档,而且中间的代理可能也不支持它。 /// ## 导入 Pydantic 的 `BaseModel` { #import-pydantics-basemodel } 从 `pydantic` 中导入 `BaseModel`: {* ../../docs_src/body/tutorial001_py310.py hl[2] *} ## 创建数据模型 { #create-your-data-model } 把数据模型声明为继承 `BaseModel` 的类。 使用 Python 标准类型声明所有属性: {* ../../docs_src/body/tutorial001_py310.py hl[5:9] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 5.9K bytes - Click Count (0) -
fastapi/dependencies/utils.py
return True # If it's a Form (or File) field, it has to be a BaseModel (or a union of BaseModels) to be top level # otherwise it has to be embedded, so that the key value pair can be extracted if ( isinstance(first_field.field_info, params.Form) and not lenient_issubclass(first_field.field_info.annotation, BaseModel) and not is_union_of_base_models(first_field.field_info.annotation) ):Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 15 11:44:39 GMT 2026 - 38.7K bytes - Click Count (3) -
tests/test_schema_compat_pydantic_v2.py
from inline_snapshot import snapshot from pydantic import BaseModel from tests.utils import needs_py310 @pytest.fixture(name="client") def get_client(): from enum import Enum app = FastAPI() class PlatformRole(str, Enum): admin = "admin" user = "user" class OtherRole(str, Enum): ... class User(BaseModel): username: str role: PlatformRole | OtherRole
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Mon Mar 23 12:36:49 GMT 2026 - 4.1K bytes - Click Count (0) -
fastapi/security/http.py
from fastapi.security.base import SecurityBase from fastapi.security.utils import get_authorization_scheme_param from pydantic import BaseModel from starlette.requests import Request from starlette.status import HTTP_401_UNAUTHORIZED class HTTPBasicCredentials(BaseModel): """ The HTTP Basic credentials given as the result of using `HTTPBasic` in a dependency. Read more about it in the
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Mon Mar 16 10:16:48 GMT 2026 - 13.1K bytes - Click Count (0) -
fastapi/openapi/models.py
class Server(BaseModelWithConfig): url: AnyUrl | str description: str | None = None variables: dict[str, ServerVariable] | None = None class Reference(BaseModel): ref: str = Field(alias="$ref") class Discriminator(BaseModel): propertyName: str mapping: dict[str, str] | None = None class XML(BaseModelWithConfig): name: str | None = None namespace: str | None = None
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 15 11:44:39 GMT 2026 - 14.2K bytes - Click Count (0) -
docs/ko/docs/features.md
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:06:26 GMT 2026 - 11K bytes - Click Count (0) -
fastapi/encoders.py
from typing import Annotated, Any from uuid import UUID from annotated_doc import Doc from fastapi.exceptions import PydanticV1NotSupportedError from fastapi.types import IncEx from pydantic import BaseModel from pydantic.color import Color # ty: ignore[deprecated] from pydantic.networks import AnyUrl, NameEmail from pydantic.types import SecretBytes, SecretStr from pydantic_core import PydanticUndefinedType
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 15 11:44:39 GMT 2026 - 10.9K bytes - Click Count (0) -
docs/ja/docs/features.md
型を使った標準的な Python を記述します: ```Python from datetime import date from pydantic import BaseModel # Declare a variable as a str # and get editor support inside the function def main(user_id: str): return user_id # A Pydantic model class User(BaseModel): id: int name: str joined: date ``` これは次のように使えます: ```Python
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:07:17 GMT 2026 - 11.6K bytes - Click Count (0)