Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 28 for forbid (0.08 seconds)

  1. docs/en/docs/tutorial/cookie-param-models.md

    But even if you **fill the data** and click "Execute", because the docs UI works with **JavaScript**, the cookies won't be sent, and you will see an **error** message as if you didn't write any values.
    
    ///
    
    ## Forbid Extra Cookies { #forbid-extra-cookies }
    
    In some special use cases (probably not very common), you might want to **restrict** the cookies that you want to receive.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 10 08:55:32 GMT 2025
    - 3.1K bytes
    - Click Count (0)
  2. docs/es/docs/tutorial/request-form-models.md

    Puedes verificarlo en la interfaz de documentación en `/docs`:
    
    <div class="screenshot">
    <img src="/img/tutorial/request-form-models/image01.png">
    </div>
    
    ## Prohibir Campos de Formulario Extra { #forbid-extra-form-fields }
    
    En algunos casos de uso especiales (probablemente no muy comunes), podrías querer **restringir** los campos de formulario a solo aquellos declarados en el modelo de Pydantic. Y **prohibir** cualquier campo **extra**.
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Tue Dec 16 16:33:45 GMT 2025
    - 2.4K bytes
    - Click Count (0)
  3. docs/es/docs/tutorial/query-param-models.md

    <img src="/img/tutorial/query-param-models/image01.png">
    </div>
    
    ## Prohibir Parámetros Query Extras { #forbid-extra-query-parameters }
    
    En algunos casos de uso especiales (probablemente no muy comunes), podrías querer **restringir** los parámetros query que deseas recibir.
    
    Puedes usar la configuración del modelo de Pydantic para `forbid` cualquier campo `extra`:
    
    {* ../../docs_src/query_param_models/tutorial002_an_py310.py hl[10] *}
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Tue Dec 16 16:33:45 GMT 2025
    - 2.3K bytes
    - Click Count (0)
  4. docs/ru/docs/tutorial/cookie-param-models.md

    ///
    
    ## Запрет дополнительных cookies { #forbid-extra-cookies }
    
    В некоторых случаях (не особо часто встречающихся) вам может понадобиться **ограничить** cookies, которые вы хотите получать.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Thu Dec 11 21:25:03 GMT 2025
    - 5K bytes
    - Click Count (0)
  5. docs/de/docs/tutorial/cookie-param-models.md

    ///
    
    ## Zusätzliche Cookies verbieten { #forbid-extra-cookies }
    
    In einigen speziellen Anwendungsfällen (wahrscheinlich nicht sehr häufig) möchten Sie möglicherweise die Cookies, die Sie empfangen möchten, **einschränken**.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 10 13:54:34 GMT 2025
    - 3.8K bytes
    - Click Count (0)
  6. docs_src/request_form_models/tutorial002_py39.py

    from fastapi import FastAPI, Form
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class FormData(BaseModel):
        username: str
        password: str
        model_config = {"extra": "forbid"}
    
    
    @app.post("/login/")
    async def login(data: FormData = Form()):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 267 bytes
    - Click Count (0)
  7. docs_src/cookie_param_models/tutorial002_py39.py

    from typing import Union
    
    from fastapi import Cookie, FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Cookies(BaseModel):
        model_config = {"extra": "forbid"}
    
        session_id: str
        fatebook_tracker: Union[str, None] = None
        googall_tracker: Union[str, None] = None
    
    
    @app.get("/items/")
    async def read_items(cookies: Cookies = Cookie()):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 381 bytes
    - Click Count (0)
  8. docs_src/query_param_models/tutorial002_py39.py

    from typing import Literal
    
    from fastapi import FastAPI, Query
    from pydantic import BaseModel, Field
    
    app = FastAPI()
    
    
    class FilterParams(BaseModel):
        model_config = {"extra": "forbid"}
    
        limit: int = Field(100, gt=0, le=100)
        offset: int = Field(0, ge=0)
        order_by: Literal["created_at", "updated_at"] = "created_at"
        tags: list[str] = []
    
    
    @app.get("/items/")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 462 bytes
    - Click Count (0)
  9. docs_src/query_param_models/tutorial002_an_py39.py

    from typing import Annotated, Literal
    
    from fastapi import FastAPI, Query
    from pydantic import BaseModel, Field
    
    app = FastAPI()
    
    
    class FilterParams(BaseModel):
        model_config = {"extra": "forbid"}
    
        limit: int = Field(100, gt=0, le=100)
        offset: int = Field(0, ge=0)
        order_by: Literal["created_at", "updated_at"] = "created_at"
        tags: list[str] = []
    
    
    @app.get("/items/")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 483 bytes
    - Click Count (0)
  10. tests/test_additional_properties_bool.py

    from typing import Union
    
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel, ConfigDict
    
    
    class FooBaseModel(BaseModel):
        model_config = ConfigDict(extra="forbid")
    
    
    class Foo(FooBaseModel):
        pass
    
    
    app = FastAPI()
    
    
    @app.post("/")
    async def post(
        foo: Union[Foo, None] = None,
    ):
        return foo
    
    
    client = TestClient(app)
    
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 18:19:10 GMT 2025
    - 3.7K bytes
    - Click Count (0)
Back to Top