v0.10.0
·
123 commits
to develop
since this release
From now on you can use ResponseEnvelope type to wrap response body and any headers you want to receive from the server.
class CatListResponse(ResponseEnvelope):
body: typing.Annotated[typing.List[Cat], ResponseBody]
count: typing.Annotated[int, Header('X-Count')]
class CatClient(ClientBase):
@get('/cats')
async def cat_list(
self: typing.Self,
) -> typing.Annotated[
CatListResponse,
Responses({
'default': {'application/json': CatListResponse},
}),
]:
pass