From d03b21ffbc5d29f3cd149b3c66edee4548be6e28 Mon Sep 17 00:00:00 2001 From: Jan Vollmer Date: Sat, 12 Oct 2024 18:22:57 +0200 Subject: [PATCH] fix: compatibility with fastapi 0.115.2 --- fastapi | 2 +- src/fastapi_deferred_init/routing.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fastapi b/fastapi index bde12fa..07684ae 160000 --- a/fastapi +++ b/fastapi @@ -1 +1 @@ -Subproject commit bde12faea20313e4570f7cb896c201058c26e546 +Subproject commit 07684aea793d042fb5a12dde46dfe6d1e2196725 diff --git a/src/fastapi_deferred_init/routing.py b/src/fastapi_deferred_init/routing.py index d26ceff..cafbb90 100644 --- a/src/fastapi_deferred_init/routing.py +++ b/src/fastapi_deferred_init/routing.py @@ -173,7 +173,9 @@ def response_fields(self) -> dict[Union[int, str], ModelField]: additional_status_code ), f"Status code {additional_status_code} must not have a response body" response_name = f"Response_{additional_status_code}_{self.unique_id}" - response_field = create_model_field(name=response_name, type_=model) + response_field = create_model_field( + name=response_name, type_=model, mode="serialization" + ) response_fields[additional_status_code] = response_field return response_fields