Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for jsonable_encoder (0.09 sec)

  1. fastapi/encoders.py

            )
            return jsonable_encoder(
                obj_dict,
                exclude_none=exclude_none,
                exclude_defaults=exclude_defaults,
                sqlalchemy_safe=sqlalchemy_safe,
            )
        if dataclasses.is_dataclass(obj):
            assert not isinstance(obj, type)
            obj_dict = dataclasses.asdict(obj)
            return jsonable_encoder(
                obj_dict,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 10.7K bytes
    - Viewed (0)
  2. fastapi/openapi/utils.py

                example = getattr(field_info, "example", None)
                if openapi_examples:
                    parameter["examples"] = jsonable_encoder(openapi_examples)
                elif example != Undefined:
                    parameter["example"] = jsonable_encoder(example)
                if getattr(field_info, "deprecated", None):
                    parameter["deprecated"] = True
                parameters.append(parameter)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 23.2K bytes
    - Viewed (0)
  3. fastapi/openapi/docs.py

    import json
    from typing import Annotated, Any, Optional
    
    from annotated_doc import Doc
    from fastapi.encoders import jsonable_encoder
    from starlette.responses import HTMLResponse
    
    swagger_ui_default_parameters: Annotated[
        dict[str, Any],
        Doc(
            """
            Default configurations for Swagger UI.
    
            You can use it as a template to add any other configurations needed.
            """
        ),
    ] = {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 10.1K bytes
    - Viewed (0)
  4. docs/ru/docs/tutorial/testing.md

    Обратите внимание, что `TestClient` принимает данные, которые можно конвертировать в JSON, но не модели Pydantic.
    
    Если в Ваших тестах есть модели Pydantic и Вы хотите отправить их в тестируемое приложение, то можете использовать функцию `jsonable_encoder`, описанную на странице [Кодировщик совместимый с JSON](encoder.md){.internal-link target=_blank}.
    
    ///
    
    ## Запуск { #run-it }
    
    Далее Вам нужно установить `pytest`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 10K bytes
    - Viewed (0)
  5. docs/ko/docs/advanced/custom-response.md

    하지만 반환하는 내용이 **JSON으로 직렬화 가능**하다고 확신하는 경우, 해당 내용을 응답 클래스에 직접 전달할 수 있으며, FastAPI가 반환 내용을 `jsonable_encoder`를 통해 처리한 뒤 응답 클래스에 전달하는 오버헤드를 피할 수 있습니다.
    
    {* ../../docs_src/custom_response/tutorial001b.py hl[2,7] *}
    
    /// info | 정보
    
    `response_class` 매개변수는 응답의 "미디어 타입"을 정의하는 데에도 사용됩니다.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Feb 15 11:21:20 UTC 2025
    - 13.4K bytes
    - Viewed (0)
  6. docs/en/docs/advanced/custom-response.md

    But if you are certain that the content that you are returning is **serializable with JSON**, you can pass it directly to the response class and avoid the extra overhead that FastAPI would have by passing your return content through the `jsonable_encoder` before passing it to the response class.
    
    {* ../../docs_src/custom_response/tutorial001b_py39.py hl[2,7] *}
    
    /// info
    
    The parameter `response_class` will also be used to define the "media type" of the response.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 12.4K bytes
    - Viewed (0)
  7. docs/de/docs/advanced/custom-response.md

    {* ../../docs_src/custom_response/tutorial001b_py39.py hl[2,7] *}
    
    /// info | Info
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 14.4K bytes
    - Viewed (0)
  8. docs/es/docs/advanced/custom-response.md

    Pero si estás seguro de que el contenido que estás devolviendo es **serializable con JSON**, puedes pasarlo directamente a la clase de response y evitar la sobrecarga extra que FastAPI tendría al pasar tu contenido de retorno a través de `jsonable_encoder` antes de pasarlo a la clase de response.
    
    {* ../../docs_src/custom_response/tutorial001b_py39.py hl[2,7] *}
    
    /// info | Información
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 13.2K bytes
    - Viewed (0)
  9. docs/ru/docs/advanced/custom-response.md

    {* ../../docs_src/custom_response/tutorial001b_py39.py hl[2,7] *}
    
    /// info | Информация
    
    Параметр `response_class` также используется для указания «типа содержимого» ответа.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 19.7K bytes
    - Viewed (0)
  10. docs/pt/docs/advanced/custom-response.md

    Mas se você tem certeza que o conteúdo que você está retornando é **serializável com JSON**, você pode passá-lo diretamente para a classe de resposta e evitar o trabalho extra que o FastAPI teria ao passar o conteúdo pelo `jsonable_encoder` antes de passar para a classe de resposta.
    
    {* ../../docs_src/custom_response/tutorial001b_py39.py hl[2,7] *}
    
    /// info | Informação
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 13.8K bytes
    - Viewed (0)
Back to top