Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 356 for Clauss (0.2 sec)

  1. tests/test_default_response_class_router.py

    from fastapi.testclient import TestClient
    
    
    class OverrideResponse(JSONResponse):
        media_type = "application/x-override"
    
    
    app = FastAPI()
    router_a = APIRouter()
    router_a_a = APIRouter()
    router_a_b_override = APIRouter()  # Overrides default class
    router_b_override = APIRouter()  # Overrides default class
    router_b_a = APIRouter()
    router_b_a_c_override = APIRouter()  # Overrides default class again
    
    
    @app.get("/")
    def get_root():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Mar 01 20:49:20 GMT 2020
    - 5K bytes
    - Viewed (0)
  2. .github/actions/people/app/main.py

    class Comments(BaseModel):
        nodes: List[CommentsNode]
    
    
    class DiscussionsComments(BaseModel):
        nodes: List[DiscussionsCommentsNode]
    
    
    class DiscussionsNode(BaseModel):
        number: int
        author: Union[Author, None] = None
        title: str
        createdAt: datetime
        comments: DiscussionsComments
    
    
    class DiscussionsEdge(BaseModel):
        cursor: str
        node: DiscussionsNode
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 17:38:21 GMT 2024
    - 19.2K bytes
    - Viewed (1)
  3. .github/actions/notify-translations/app/main.py

    
    class AddCommentData(BaseModel):
        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):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Sep 27 23:01:46 GMT 2023
    - 12.4K bytes
    - Viewed (0)
  4. docs_src/extra_models/tutorial002.py

    from fastapi import FastAPI
    from pydantic import BaseModel, EmailStr
    
    app = FastAPI()
    
    
    class UserBase(BaseModel):
        username: str
        email: EmailStr
        full_name: Union[str, None] = None
    
    
    class UserIn(UserBase):
        password: str
    
    
    class UserOut(UserBase):
        pass
    
    
    class UserInDB(UserBase):
        hashed_password: str
    
    
    def fake_password_hasher(raw_password: str):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 824 bytes
    - Viewed (0)
  5. tests/test_response_model_data_filter_no_inheritance.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class UserCreate(BaseModel):
        email: str
        password: str
    
    
    class UserDB(BaseModel):
        email: str
        hashed_password: str
    
    
    class User(BaseModel):
        email: str
    
    
    class PetDB(BaseModel):
        name: str
        owner: UserDB
    
    
    class PetOut(BaseModel):
        name: str
        owner: User
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  6. tests/test_additional_responses_custom_validationerror.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class JsonApiResponse(JSONResponse):
        media_type = "application/vnd.api+json"
    
    
    class Error(BaseModel):
        status: str
        title: str
    
    
    class JsonApiError(BaseModel):
        errors: typing.List[Error]
    
    
    @app.get(
        "/a/{id}",
        response_class=JsonApiResponse,
        responses={422: {"description": "Error", "model": JsonApiError}},
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  7. docs_src/openapi_callbacks/tutorial001.py

    from fastapi import APIRouter, FastAPI
    from pydantic import BaseModel, HttpUrl
    
    app = FastAPI()
    
    
    class Invoice(BaseModel):
        id: str
        title: Union[str, None] = None
        customer: str
        total: float
    
    
    class InvoiceEvent(BaseModel):
        description: str
        paid: bool
    
    
    class InvoiceEventReceived(BaseModel):
        ok: bool
    
    
    invoices_callback_router = APIRouter()
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 1.3K bytes
    - Viewed (0)
  8. docs_src/response_model/tutorial003_01_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel, EmailStr
    
    app = FastAPI()
    
    
    class BaseUser(BaseModel):
        username: str
        email: EmailStr
        full_name: str | None = None
    
    
    class UserIn(BaseUser):
        password: str
    
    
    @app.post("/user/")
    async def create_user(user: UserIn) -> BaseUser:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 317 bytes
    - Viewed (0)
  9. docs_src/response_model/tutorial003_01.py

    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel, EmailStr
    
    app = FastAPI()
    
    
    class BaseUser(BaseModel):
        username: str
        email: EmailStr
        full_name: Union[str, None] = None
    
    
    class UserIn(BaseUser):
        password: str
    
    
    @app.post("/user/")
    async def create_user(user: UserIn) -> BaseUser:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Jan 07 13:45:48 GMT 2023
    - 349 bytes
    - Viewed (0)
  10. docs_src/security/tutorial004_an_py310.py

            "disabled": False,
        }
    }
    
    
    class Token(BaseModel):
        access_token: str
        token_type: str
    
    
    class TokenData(BaseModel):
        username: str | None = None
    
    
    class User(BaseModel):
        username: str
        email: str | None = None
        full_name: str | None = None
        disabled: bool | None = None
    
    
    class UserInDB(User):
        hashed_password: str
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 4.1K bytes
    - Viewed (0)
Back to top