Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 121 - 130 of 2,086 for FastAPI (0.04 seconds)

  1. docs/en/docs/tutorial/stream-json-lines.md

    /// tip
    
    If you want to stream binary data, for example video or audio, check the advanced guide: [Stream Data](../advanced/stream-data.md).
    
    ///
    
    ## Stream JSON Lines with FastAPI { #stream-json-lines-with-fastapi }
    
    To stream JSON Lines with FastAPI you can, instead of using `return` in your *path operation function*, use `yield` to produce each item in turn.
    
    {* ../../docs_src/stream_json_lines/tutorial001_py310.py ln[1:24] hl[24] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 4.3K bytes
    - Click Count (0)
  2. tests/test_security_api_key_query.py

    from fastapi import Depends, FastAPI, Security
    from fastapi.security import APIKeyQuery
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    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
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:18:38 GMT 2026
    - 2K bytes
    - Click Count (0)
  3. tests/test_security_http_base_description.py

    from fastapi import FastAPI, Security
    from fastapi.security.http import HTTPAuthorizationCredentials, HTTPBase
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    app = FastAPI()
    
    security = HTTPBase(scheme="Other", description="Other Security Scheme")
    
    
    @app.get("/users/me")
    def read_current_user(credentials: HTTPAuthorizationCredentials = Security(security)):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:18:38 GMT 2026
    - 2.1K bytes
    - Click Count (0)
  4. tests/test_security_http_base_optional.py

    from fastapi import FastAPI, Security
    from fastapi.security.http import HTTPAuthorizationCredentials, HTTPBase
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    app = FastAPI()
    
    security = HTTPBase(scheme="Other", auto_error=False)
    
    
    @app.get("/users/me")
    def read_current_user(
        credentials: HTTPAuthorizationCredentials | None = Security(security),
    ):
        if credentials is None:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 2K bytes
    - Click Count (0)
  5. docs/ja/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md

    # Pydantic v1 から Pydantic v2 への移行 { #migrate-from-pydantic-v1-to-pydantic-v2 }
    
    古い FastAPI アプリがある場合、Pydantic v1 を使っているかもしれません。
    
    FastAPI 0.100.0 は Pydantic v1 / v2 のどちらにも対応しており、インストールされている方を使用しました。
    
    FastAPI 0.119.0 では、Pydantic v2 内からの Pydantic v1 の部分的サポート(`pydantic.v1`)が導入され、v2 への移行が容易になりました。
    
    FastAPI 0.126.0 で Pydantic v1 のサポートは終了しましたが、しばらくの間は `pydantic.v1` は利用可能でした。
    
    /// warning | 注意
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 6.2K bytes
    - Click Count (0)
  6. docs/en/docs/how-to/graphql.md

    Here are some of the **GraphQL** libraries that have **ASGI** support. You could use them with **FastAPI**:
    
    * [Strawberry](https://strawberry.rocks/) 🍓
        * With [docs for FastAPI](https://strawberry.rocks/docs/integrations/fastapi)
    * [Ariadne](https://ariadnegraphql.org/)
        * With [docs for FastAPI](https://ariadnegraphql.org/docs/fastapi-integration)
    * [Tartiflette](https://tartiflette.io/)
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 2.7K bytes
    - Click Count (0)
  7. tests/test_schema_ref_pydantic_v2.py

    from typing import Any
    
    import pytest
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    from pydantic import BaseModel, ConfigDict, Field
    
    
    @pytest.fixture(name="client")
    def get_client():
        app = FastAPI()
    
        class ModelWithRef(BaseModel):
            ref: str = Field(validation_alias="$ref", serialization_alias="$ref")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 2.1K bytes
    - Click Count (0)
  8. tests/test_security_http_digest_optional.py

    from fastapi import FastAPI, Security
    from fastapi.security import HTTPAuthorizationCredentials, HTTPDigest
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    app = FastAPI()
    
    security = HTTPDigest(auto_error=False)
    
    
    @app.get("/users/me")
    def read_current_user(
        credentials: HTTPAuthorizationCredentials | None = Security(security),
    ):
        if credentials is None:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 2.3K bytes
    - Click Count (0)
  9. docs/zh-hant/docs/tutorial/security/first-steps.md

    此相依性會提供一個 `str`,指派給「路徑操作函式」的參數 `token`。
    
    FastAPI 會知道可以使用這個相依性,在 OpenAPI(以及自動產生的 API 文件)中定義一個「安全性方案」。
    
    /// info | 技術細節
    
    FastAPI 之所以知道可以用(相依性中宣告的)`OAuth2PasswordBearer` 類別,在 OpenAPI 中定義安全性方案,是因為它繼承自 `fastapi.security.oauth2.OAuth2`,而後者又繼承自 `fastapi.security.base.SecurityBase`。
    
    所有能與 OpenAPI(以及自動 API 文件)整合的安全工具都繼承自 `SecurityBase`,FastAPI 才能知道如何把它們整合進 OpenAPI。
    
    ///
    
    ## 它做了什麼 { #what-it-does }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 7.2K bytes
    - Click Count (0)
  10. docs/zh/docs/tutorial/security/first-steps.md

    该依赖会提供一个 `str`,赋值给*路径操作函数*的参数 `token`。
    
    **FastAPI** 会据此在 OpenAPI 架构(以及自动生成的 API 文档)中定义一个“安全方案”。
    
    /// info | 技术细节
    
    **FastAPI** 之所以知道可以使用(在依赖中声明的)`OAuth2PasswordBearer` 在 OpenAPI 中定义安全方案,是因为它继承自 `fastapi.security.oauth2.OAuth2`,而后者又继承自 `fastapi.security.base.SecurityBase`。
    
    所有与 OpenAPI(以及自动 API 文档)集成的安全工具都继承自 `SecurityBase`,这就是 **FastAPI** 能将它们集成到 OpenAPI 的方式。
    
    ///
    
    ## 它做了什么 { #what-it-does }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 7.5K bytes
    - Click Count (0)
Back to Top