Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 22 for ORJSONResponse (0.13 seconds)

  1. tests/test_deprecated_responses.py

        assert response.json() == {"name": "widget", "price": 9.99}
    
    
    def test_orjson_response_emits_deprecation_warning():
        with pytest.warns(FastAPIDeprecationWarning, match="ORJSONResponse is deprecated"):
            ORJSONResponse(content={"hello": "world"})
    
    
    # UJSON
    
    
    def _make_ujson_app() -> FastAPI:
        with warnings.catch_warnings():
            warnings.simplefilter("ignore", FastAPIDeprecationWarning)
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 22 16:34:59 GMT 2026
    - 2K bytes
    - Click Count (0)
  2. tests/test_orjson_response_class.py

    from fastapi.exceptions import FastAPIDeprecationWarning
    from fastapi.responses import ORJSONResponse
    from fastapi.testclient import TestClient
    from sqlalchemy.sql.elements import quoted_name
    
    with warnings.catch_warnings():
        warnings.simplefilter("ignore", FastAPIDeprecationWarning)
        app = FastAPI(default_response_class=ORJSONResponse)
    
    
    @app.get("/orjson_non_str_keys")
    def get_orjson_non_str_keys():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 22 16:34:59 GMT 2026
    - 846 bytes
    - Click Count (0)
  3. docs_src/custom_response/tutorial001b_py310.py

    from fastapi import FastAPI
    from fastapi.responses import ORJSONResponse
    
    app = FastAPI()
    
    
    @app.get("/items/", response_class=ORJSONResponse)
    async def read_items():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 215 bytes
    - Click Count (0)
  4. fastapi/responses.py

        "and https://fastapi.tiangolo.com/tutorial/response-model/",
        category=FastAPIDeprecationWarning,
        stacklevel=2,
    )
    class ORJSONResponse(JSONResponse):
        """JSON response using the orjson library to serialize data to JSON.
    
        **Deprecated**: `ORJSONResponse` is deprecated. FastAPI now serializes data
        directly to JSON bytes via Pydantic when a return type or response model is
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 09:21:52 GMT 2026
    - 3.6K bytes
    - Click Count (0)
  5. docs/en/docs/reference/responses.md

    You can import them directly from `fastapi.responses`:
    
    ```python
    from fastapi.responses import (
        FileResponse,
        HTMLResponse,
        JSONResponse,
        ORJSONResponse,
        PlainTextResponse,
        RedirectResponse,
        Response,
        StreamingResponse,
        UJSONResponse,
    )
    ```
    
    ## FastAPI Responses
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 22 16:34:59 GMT 2026
    - 4.4K bytes
    - Click Count (0)
  6. pyproject.toml

        "pyyaml >=5.3.1,<7.0.0",
        "typer >=0.21.1",
    ]
    docs-tests = [
        "httpx >=0.23.0,<1.0.0",
        "ruff >=0.14.14",
        # For UJSONResponse
        "ujson >=5.8.0",
        # For ORJSONResponse
        "orjson >=3.9.3",
    ]
    github-actions = [
        "httpx >=0.27.0,<1.0.0",
        "pydantic >=2.9.0,<3.0.0",
        "pydantic-settings >=2.1.0,<3.0.0",
        "pygithub >=2.3.0,<3.0.0",
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Mon Mar 23 12:36:49 GMT 2026
    - 10.3K bytes
    - Click Count (0)
  7. fastapi/.agents/skills/fastapi/SKILL.md

    async def get_item() -> Any:
        item = InternalItem(
            name="Foo", description="A very nice Item", secret_key="supersecret"
        )
        return item
    ```
    
    ## Performance
    
    Do not use `ORJSONResponse` or `UJSONResponse`, they are deprecated.
    
    Instead, declare a return type or response model. Pydantic will handle the data serialization on the Rust side.
    
    ## Including Routers
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 10:05:57 GMT 2026
    - 10.1K bytes
    - Click Count (0)
  8. docs/uk/docs/index.md

    Додаткові необовʼязкові залежності FastAPI:
    
    * [`orjson`](https://github.com/ijl/orjson) - потрібно, якщо ви хочете використовувати `ORJSONResponse`.
    * [`ujson`](https://github.com/esnme/ultrajson) - потрібно, якщо ви хочете використовувати `UJSONResponse`.
    
    ## Ліцензія { #license }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:27:41 GMT 2026
    - 29.1K bytes
    - Click Count (0)
  9. docs/de/docs/index.md

    Zusätzliche optionale FastAPI-Abhängigkeiten:
    
    * [`orjson`](https://github.com/ijl/orjson) – erforderlich, wenn Sie `ORJSONResponse` verwenden möchten.
    * [`ujson`](https://github.com/esnme/ultrajson) – erforderlich, wenn Sie `UJSONResponse` verwenden möchten.
    
    ## Lizenz { #license }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:58:09 GMT 2026
    - 23.6K bytes
    - Click Count (1)
  10. docs/zh/docs/index.md

    * [`pydantic-extra-types`](https://docs.pydantic.dev/latest/usage/types/extra_types/extra_types/) - 用于在 Pydantic 中使用的额外类型。
    
    额外的 FastAPI 可选依赖:
    
    * [`orjson`](https://github.com/ijl/orjson) - 使用 `ORJSONResponse` 时需要。
    * [`ujson`](https://github.com/esnme/ultrajson) - 使用 `UJSONResponse` 时需要。
    
    ## 许可协议 { #license }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 20.7K bytes
    - Click Count (0)
Back to Top