Skip to content

Conversation

superleesa
Copy link

@superleesa superleesa commented Oct 26, 2024

Add output (and maybe input) types to response (requests).
For details, please see: #199

How to achive this:

  • use generic to distinguish client of Endpoint instance between Client and AsyncClient
  • use the generic and overload decorator to add two overloads (one for sync and another one async) of each request method

@superleesa superleesa changed the title Add types (POC) [Draft] Add types (POC) Oct 26, 2024
@@ -131,15 +131,16 @@ def _parse_response(self, response: Response) -> Any:

return body

@abstractclassmethod
@abstractmethod
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

def request(
self,
path: str,
method: str,
cast_to: Type[ResponseType],
Copy link
Owner

@ramnes ramnes Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we avoid to add this new cast_to argument?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants