Conversation
T4rk1n
left a comment
There was a problem hiding this comment.
This look like a nice feature, just need to add a docstring to the new argument and a test.
|
Is there another way to setup the apis rather than calling |
T4rk1n
left a comment
There was a problem hiding this comment.
Let's only keep the GLOBAL_API_PATHS and use that for the registering.
| ) | ||
| callback_map = _kwargs.pop("callback_map", GLOBAL_CALLBACK_MAP) | ||
| callback_list = _kwargs.pop("callback_list", GLOBAL_CALLBACK_LIST) | ||
| callback_api_paths = _kwargs.pop("callback_api_paths", GLOBAL_API_PATHS) |
There was a problem hiding this comment.
Let's only have the global one, having two variables for the same functionality creates issue like #3419 and add complexity.
| def _setup_server(self): | ||
| if self._got_first_request["setup_server"]: | ||
| return | ||
|
|
There was a problem hiding this comment.
I think it's missing a call to setup_apis or is it meant to be called by the user?
There was a problem hiding this comment.
Routes must be registered by the dev before the server is started, therefore it cant go here to automatically setup.
|
This seems very cool as a feature 🙌 But I can't think of where I would actually use it... As inspiration, please could you give some examples of where you think this would be useful? |

This PR strives to allow callbacks to be exposed by the underlying server as an API by simply passing the callback a
api_endpoint. The api will accept a body with the functional arguments provided askwargs.