Martijn Pieters
f78a599bbc
Decode cache data to the correct endpoint type
...
Use the return annotation to decode cached data to the correct type.
This follows the same logic FastAPI uses to JSON request bodies.
For the PickleCoder, this is a no-op as pickle already stores type
information in the serialised data.
2023-05-08 16:55:05 +01:00
Martijn Pieters
d4cd787527
JSONResponse.body is UTF-8 bytes and must be decoded
2023-04-27 16:20:12 +01:00
Martijn Pieters
059793d585
Remove a type: ignore comment
...
GIve the type checker more information about the converters instead.
2023-04-27 16:19:02 +01:00
Ivan Moiseev
9a39db7a73
Merge branch 'long2ice:main' into fix/piclke-coder
2023-01-11 16:26:05 +03:00
vvanglro
614ee25d0d
feat: merge master
2023-01-07 13:46:48 +08:00
long2ice
8f0920d0d7
ci: fix
2022-11-07 16:39:17 +08:00
Ivan Moiseev
cb9fe5c065
fix: PickleCoder and add tests for it.
2022-11-05 13:45:16 +04:00
vvanglro
4cb4afeff0
feat: support cache JSONResponse
2022-11-04 17:31:37 +08:00
Ivan Moiseev
5881bb9122
Merge branch 'main' into feat/type-hints-covering
...
# Conflicts:
# fastapi_cache/coder.py
# fastapi_cache/decorator.py
2022-11-03 15:53:22 +04:00
Ivan Moiseev
e842d6408e
feat: make PickleCoder compatible with backends
2022-10-22 21:06:38 +04:00
Ivan Moiseev
4c6abcf786
feat: add more type hints
2022-10-22 20:59:37 +04:00
vvanglro
7e64cd6490
feat: support cache jinja2 template response
2022-09-28 17:37:05 +08:00
long2ice
824e2e145f
Replace aioredis with redis-py
2022-06-17 11:01:47 +08:00
long2ice
c3be2eca19
Fix default json coder for datetime.
2021-10-09 16:51:05 +08:00
long2ice
37a2fa85db
update CONVERTERS
2021-09-17 10:19:56 +08:00
long2ice
767241be41
- Fix redis cache.
...
- Encode key builder.
2021-07-26 16:33:22 +08:00
long2ice
7c2007847f
Merge pull request #8 from rushilsrivastava/patch-2
...
Use FastAPI's built in jsonable_encoder
2021-04-30 16:48:07 +08:00
alexandr.yagolovich
eb55b01be9
timezone serializer to coder.JsonEncoder for datetime.datetime instances
2021-04-28 20:44:35 +03:00
Rushil Srivastava
30e5246cf5
Use FastAPI's built in jsonable_encoder
2021-01-11 03:11:35 -08:00
long2ice
dc2ac9cc90
Add default config when init
...
update JsonEncoder
2020-10-16 16:55:33 +08:00
long2ice
c20bb73f27
first commit
2020-08-26 18:04:57 +08:00