Fix many type errors.
This commit is contained in:
@@ -19,13 +19,15 @@ class MsgpackRequest(Request):
|
||||
class MsgpackResponse(Response):
|
||||
media_type = "application/msgpack"
|
||||
|
||||
def render(self, content: t.Optional[t.Any]) -> t.Optional[bytes]:
|
||||
def render(self, content: t.Optional[t.Any]) -> bytes:
|
||||
if content is None:
|
||||
return b""
|
||||
|
||||
if isinstance(content, BaseModel):
|
||||
content = content.dict()
|
||||
return msgpack.packb(content, use_bin_type=True)
|
||||
ret = msgpack.packb(content, use_bin_type=True)
|
||||
assert ret is not None
|
||||
return ret
|
||||
|
||||
|
||||
class MsgpackRoute(APIRoute):
|
||||
|
||||
Reference in New Issue
Block a user