From 9217c85d94662537b6dc63cab35a013dcbee2788 Mon Sep 17 00:00:00 2001 From: Samuel Rigaud <46346622+s-rigaud@users.noreply.github.com> Date: Sun, 20 Aug 2023 01:27:10 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Use=20create=5Fsome=5Fmodel=20as?= =?UTF-8?q?=20a=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4bac139..9950c69 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ from .models import SomeModel, create_some_model @app.get("/foo") @cache(expire=60) async def foo() -> SomeModel: - return create_some_model + return create_some_model() ``` It is not sufficient to configure a response model in the route decorator; the cache needs to know what the method itself returns. If no return type decorator is given, the primitive JSON type is returned instead.