Search Options

Results per page
Sort
Preferred Languages
Advance

Results 591 - 600 of 850 for pydantic (0.05 sec)

  1. docs_src/app_testing/app_b_an_py310/main.py

    from typing import Annotated
    
    from fastapi import FastAPI, Header, HTTPException
    from pydantic import BaseModel
    
    fake_secret_token = "coneofsilence"
    
    fake_db = {
        "foo": {"id": "foo", "title": "Foo", "description": "There goes my hero"},
        "bar": {"id": "bar", "title": "Bar", "description": "The bartenders"},
    }
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        id: str
        title: str
        description: str | None = None
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Aug 15 22:31:16 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  2. docs/em/docs/advanced/security/oauth2-scopes.md

    ```
    
    ## โœ” `username` & ๐Ÿ’ฝ ๐Ÿ’ 
    
    ๐Ÿ‘ฅ โœ” ๐Ÿ‘ˆ ๐Ÿ‘ฅ ๐Ÿคš `username`, & โš— โ†”.
    
    & โคด๏ธ ๐Ÿ‘ฅ โœ” ๐Ÿ‘ˆ ๐Ÿ“Š โฎ๏ธ Pydantic ๐Ÿท (โœŠ `ValidationError` โš ), & ๐Ÿšฅ ๐Ÿ‘ฅ ๐Ÿคš โŒ ๐Ÿ‘‚ ๐Ÿฅ™ ๐Ÿค โš–๏ธ โš– ๐Ÿ“Š โฎ๏ธ Pydantic, ๐Ÿ‘ฅ ๐Ÿคš `HTTPException` ๐Ÿ‘ฅ โœ โญ.
    
    ๐Ÿ‘ˆ, ๐Ÿ‘ฅ โ„น Pydantic ๐Ÿท `TokenData` โฎ๏ธ ๐Ÿ†• ๐Ÿ  `scopes`.
    
    โš– ๐Ÿ“Š โฎ๏ธ Pydantic ๐Ÿ‘ฅ ๐Ÿ’ช โš’ ๐Ÿ’ญ ๐Ÿ‘ˆ ๐Ÿ‘ฅ โœ”๏ธ, ๐Ÿ–ผ, โšซ๏ธโ” `list` `str` โฎ๏ธ โ†” & `str` โฎ๏ธ `username`.
    
    โ†ฉ๏ธ, ๐Ÿ–ผ, `dict`, โš–๏ธ ๐Ÿ•ณ ๐Ÿ™†, โšซ๏ธ ๐Ÿ’ช ๐Ÿ’” ๐Ÿˆธ โ˜ โช, โš’ โšซ๏ธ ๐Ÿ’‚โ€โ™‚ โš .
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 11K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_cookie_params/test_tutorial001_an_py310.py

                                        "title": "Ads Id",
                                    }
                                )
                                | IsDict(
                                    # TODO: remove when deprecating Pydantic v1
                                    {"title": "Ads Id", "type": "string"}
                                ),
                                "name": "ads_id",
                                "in": "cookie",
                            }
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_header_params/test_tutorial002_an_py310.py

                                        "title": "Strange Header",
                                    }
                                )
                                | IsDict(
                                    # TODO: remove when deprecating Pydantic v1
                                    {"title": "Strange Header", "type": "string"}
                                ),
                                "name": "strange_header",
                                "in": "header",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.2K bytes
    - Viewed (0)
  5. docs_src/app_testing/app_b_an/main.py

    from typing import Union
    
    from fastapi import FastAPI, Header, HTTPException
    from pydantic import BaseModel
    from typing_extensions import Annotated
    
    fake_secret_token = "coneofsilence"
    
    fake_db = {
        "foo": {"id": "foo", "title": "Foo", "description": "There goes my hero"},
        "bar": {"id": "bar", "title": "Bar", "description": "The bartenders"},
    }
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        id: str
        title: str
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Aug 15 22:31:16 UTC 2024
    - 1.2K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/handling-errors.md

    ///
    
    `RequestValidationError` is a sub-class of Pydantic's <a href="https://docs.pydantic.dev/latest/concepts/models/#error-handling" class="external-link" target="_blank">`ValidationError`</a>.
    
    **FastAPI** uses it so that, if you use a Pydantic model in `response_model`, and your data has an error, you will see the error in your log.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  7. tests/test_security_api_key_query.py

    from fastapi import Depends, FastAPI, Security
    from fastapi.security import APIKeyQuery
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    api_key = APIKeyQuery(name="key")
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: str = Security(api_key)):
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  8. tests/test_security_api_key_cookie.py

    from fastapi import Depends, FastAPI, Security
    from fastapi.security import APIKeyCookie
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    api_key = APIKeyCookie(name="key")
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: str = Security(api_key)):
        user = User(username=oauth_header)
        return user
    
    
    @app.get("/users/me")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  9. tests/test_security_api_key_cookie_description.py

    from fastapi import Depends, FastAPI, Security
    from fastapi.security import APIKeyCookie
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    api_key = APIKeyCookie(name="key", description="An API Cookie Key")
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: str = Security(api_key)):
        user = User(username=oauth_header)
        return user
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  10. docs_src/security/tutorial003_an.py

    from typing import Union
    
    from fastapi import Depends, FastAPI, HTTPException, status
    from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
    from pydantic import BaseModel
    from typing_extensions import Annotated
    
    fake_users_db = {
        "johndoe": {
            "username": "johndoe",
            "full_name": "John Doe",
            "email": "******@****.***",
            "hashed_password": "fakehashedsecret",
            "disabled": False,
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 2.5K bytes
    - Viewed (0)
Back to top