Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 175 for SET (0.16 sec)

  1. tests/test_reponse_set_reponse_code_empty.py

    async def delete_deployment(
        id: int,
        response: Response,
    ) -> Any:
        response.status_code = 400
        return {"msg": "Status overwritten", "id": id}
    
    
    client = TestClient(app)
    
    
    def test_dependency_set_status_code():
        response = client.delete("/1")
        assert response.status_code == 400 and response.content
        assert response.json() == {"msg": "Status overwritten", "id": 1}
    
    
    def test_openapi_schema():
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  2. tests/test_repeated_cookie_headers.py

    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    def set_cookie(*, response: Response):
        response.set_cookie("cookie-name", "cookie-value")
        return {}
    
    
    def set_indirect_cookie(*, dep: str = Depends(set_cookie)):
        return dep
    
    
    @app.get("/directCookie")
    def get_direct_cookie(dep: str = Depends(set_cookie)):
        return {"dep": dep}
    
    
    @app.get("/indirectCookie")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jun 13 12:44:51 GMT 2020
    - 792 bytes
    - Viewed (0)
  3. docs/en/layouts/custom.yml

        {%- if layout.background_color -%}
          {{ layout.background_color }}
        {%- else -%}
          {%- set palette = config.theme.palette or {} -%}
          {%- if not palette is mapping -%}
            {%- set palette = palette | first -%}
          {%- endif -%}
          {%- set primary = palette.get("primary", "indigo") -%}
          {%- set primary = primary.replace(" ", "-") -%}
          {{ {
            "red":         "#ef5552",
    Others
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Jun 26 14:05:43 GMT 2023
    - 6.5K bytes
    - Viewed (0)
  4. docs_src/path_operation_configuration/tutorial001.py

    from typing import Set, Union
    
    from fastapi import FastAPI, status
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
        tags: Set[str] = set()
    
    
    @app.post("/items/", response_model=Item, status_code=status.HTTP_201_CREATED)
    async def create_item(item: Item):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 406 bytes
    - Viewed (0)
  5. docs_src/path_operation_configuration/tutorial003_py310.py

        name: str
        description: str | None = None
        price: float
        tax: float | None = None
        tags: set[str] = set()
    
    
    @app.post(
        "/items/",
        response_model=Item,
        summary="Create an item",
        description="Create an item with all the information, name, description, price, tax and a set of unique tags",
    )
    async def create_item(item: Item):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 474 bytes
    - Viewed (0)
  6. docs_src/body_nested_models/tutorial007.py

    from typing import List, Set, Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel, HttpUrl
    
    app = FastAPI()
    
    
    class Image(BaseModel):
        url: HttpUrl
        name: str
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
        tags: Set[str] = set()
        images: Union[List[Image], None] = None
    
    
    class Offer(BaseModel):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 581 bytes
    - Viewed (0)
  7. docs_src/path_operation_configuration/tutorial003_py39.py

        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
        tags: set[str] = set()
    
    
    @app.post(
        "/items/",
        response_model=Item,
        summary="Create an item",
        description="Create an item with all the information, name, description, price, tax and a set of unique tags",
    )
    async def create_item(item: Item):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 512 bytes
    - Viewed (0)
  8. docs_src/path_operation_configuration/tutorial004_py39.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
        tags: set[str] = set()
    
    
    @app.post("/items/", response_model=Item, summary="Create an item")
    async def create_item(item: Item):
        """
        Create an item with all the information:
    
        - **name**: each item must have a name
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 676 bytes
    - Viewed (0)
  9. docs_src/path_operation_configuration/tutorial005_py39.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
        tags: set[str] = set()
    
    
    @app.post(
        "/items/",
        response_model=Item,
        summary="Create an item",
        response_description="The created item",
    )
    async def create_item(item: Item):
        """
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 736 bytes
    - Viewed (0)
  10. docs/pt/docs/tutorial/extra-data-types.md

    * `frozenset`:
        * Em requisições e respostas, será tratado da mesma forma que um `set`:
            * Nas requisições, uma lista será lida, eliminando duplicadas e convertendo-a em um `set`.
            * Nas respostas, o `set` será convertido para uma `list`.
            * O esquema gerado vai especificar que os valores do `set` são unicos (usando o `uniqueItems` do JSON Schema).
    * `bytes`:
        * O `bytes` padrão do Python.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 3K bytes
    - Viewed (0)
Back to top