Commit Graph

9 Commits

Author SHA1 Message Date
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
832650347b Attach updated endpoint signature to inner
Not all endpoints accept a __signature__ attribute, nor should the
cache decorator modify the decorated endpoint. Attach the signature
to the returned inner function instead.

While here, refactor the signature updating code, and extract it to
a separate function.
2023-04-27 18:14:59 +01:00
long2ice
27acce3160 ci: fix poetry 2023-02-15 10:45:19 +08:00
Naoki Shima
98cf8a78a1 adding test coverage 2023-02-15 10:35:41 +09:00
long2ice
59a47b7fae chore: set version 0.2.0 2023-01-11 21:20:41 +08:00
vvanglro
2710129c4e feat: cache response obj add test case 2022-11-04 17:34:20 +08:00
Charl P. Botha
630b175766 Add tests for sync and disabled cache 2022-10-14 21:59:33 +02:00
long2ice
cb9259807e feat: make request and response optional 2022-09-10 20:06:37 +08:00
Ryan Truran
89826b0a3b added InMemory example 2022-02-24 10:07:33 -06:00