Skip to content

Refactor api.client module to offer url from endpoint

In the api.client module:

  • The API instance should be injected as a dependency in the Client instance (composition).

  • The API class should not be public, so prefix it with an underscore.

  • Why API.reverse_url() needs arguments already in conn_handler ?

    • As the endpoint can define the scheme for sure, we can withdraw it and get it from the ConnHandler class.
    • But for that, the ConnHandler class need to set only one scheme!
  • Expose a method to easily get the url of an endpoint (refactor reverse_url of API in public Client class).

If we do that:

  • Set only one scheme (with http, https, ws, wss) in ConnHandler class We can do that:
  • Get the api url from the connhandler without giving any scheme.
Edited by Vincent Texier
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information