Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 54 for BaseModel (0.07 sec)

  1. scripts/notify_translations.py

        addDiscussionComment: AddDiscussionComment
    
    
    class AddCommentResponse(BaseModel):
        data: AddCommentData
    
    
    class CommentsEdge(BaseModel):
        node: Comment
        cursor: str
    
    
    class Comments(BaseModel):
        edges: list[CommentsEdge]
    
    
    class CommentsDiscussion(BaseModel):
        comments: Comments
    
    
    class CommentsRepository(BaseModel):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 12.7K bytes
    - Viewed (0)
  2. scripts/people.py

    class DiscussionsComments(BaseModel):
        totalCount: int
        nodes: list[DiscussionsCommentsNode]
    
    
    class DiscussionsNode(BaseModel):
        number: int
        author: Union[Author, None] = None
        title: str | None = None
        createdAt: datetime
        comments: DiscussionsComments
    
    
    class DiscussionsEdge(BaseModel):
        cursor: str
        node: DiscussionsNode
    
    
    class Discussions(BaseModel):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 12.3K bytes
    - Viewed (0)
  3. tests/test_sub_callbacks.py

    from fastapi.testclient import TestClient
    from pydantic import BaseModel, HttpUrl
    
    app = FastAPI()
    
    
    class Invoice(BaseModel):
        id: str
        title: Optional[str] = None
        customer: str
        total: float
    
    
    class InvoiceEvent(BaseModel):
        description: str
        paid: bool
    
    
    class InvoiceEventReceived(BaseModel):
        ok: bool
    
    
    invoices_callback_router = APIRouter()
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 12.9K bytes
    - Viewed (0)
  4. tests/test_request_params/test_form/test_optional_list.py

    from typing import Annotated, Optional
    
    import pytest
    from fastapi import FastAPI, Form
    from fastapi.testclient import TestClient
    from pydantic import BaseModel, Field
    
    from .utils import get_body_model_name
    
    app = FastAPI()
    
    # =====================================================================================
    # Without aliases
    
    
    @app.post("/optional-list-str", operation_id="optional_list_str")
    async def read_optional_list_str(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 9.9K bytes
    - Viewed (0)
  5. 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] = []
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 19.1K bytes
    - Viewed (0)
  6. tests/benchmarks/test_general_performance.py

    
    def dep_b(a: Annotated[int, Depends(dep_a)]):
        return a + 2
    
    
    class ItemIn(BaseModel):
        name: str
        value: int
    
    
    class ItemOut(BaseModel):
        name: str
        value: int
        dep: int
    
    
    class LargeIn(BaseModel):
        items: list[dict[str, Any]]
        metadata: dict[str, Any]
    
    
    class LargeOut(BaseModel):
        items: list[dict[str, Any]]
        metadata: dict[str, Any]
    
    
    app = FastAPI()
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 20:40:26 UTC 2025
    - 11.1K bytes
    - Viewed (0)
  7. tests/test_request_params/test_header/test_required_str.py

    from fastapi.testclient import TestClient
    from pydantic import BaseModel, Field
    
    app = FastAPI()
    
    # =====================================================================================
    # Without aliases
    
    
    @app.get("/required-str")
    async def read_required_str(p: Annotated[str, Header()]):
        return {"p": p}
    
    
    class HeaderModelRequiredStr(BaseModel):
        p: str
    
    
    @app.get("/model-required-str")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 10K bytes
    - Viewed (0)
  8. tests/test_request_params/test_query/test_required_str.py

    from fastapi.testclient import TestClient
    from pydantic import BaseModel, Field
    
    app = FastAPI()
    
    # =====================================================================================
    # Without aliases
    
    
    @app.get("/required-str")
    async def read_required_str(p: str):
        return {"p": p}
    
    
    class QueryModelRequiredStr(BaseModel):
        p: str
    
    
    @app.get("/model-required-str")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 9.9K bytes
    - Viewed (0)
  9. tests/test_request_params/test_form/test_required_str.py

    from typing import Annotated
    
    import pytest
    from dirty_equals import IsOneOf
    from fastapi import FastAPI, Form
    from fastapi.testclient import TestClient
    from pydantic import BaseModel, Field
    
    from .utils import get_body_model_name
    
    app = FastAPI()
    
    # =====================================================================================
    # Without aliases
    
    
    @app.post("/required-str", operation_id="required_str")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 10.6K bytes
    - Viewed (0)
  10. tests/test_request_params/test_header/test_list.py

    from fastapi.testclient import TestClient
    from pydantic import BaseModel, Field
    
    app = FastAPI()
    
    # =====================================================================================
    # Without aliases
    
    
    @app.get("/required-list-str")
    async def read_required_list_str(p: Annotated[list[str], Header()]):
        return {"p": p}
    
    
    class HeaderModelRequiredListStr(BaseModel):
        p: list[str]
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:31:34 UTC 2025
    - 11K bytes
    - Viewed (0)
Back to top