Merge pull request #280 from s-rigaud/update-readme

📝 Use create_some_model as a function
This commit is contained in:
long2ice
2023-08-22 10:00:15 +08:00
committed by GitHub

View File

@@ -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.