Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp 'api_handler()' #3713

Open
fregataa opened this issue Feb 16, 2025 — with Lablup-Issue-Syncer · 0 comments · May be fixed by #3714
Open

Revamp 'api_handler()' #3713

fregataa opened this issue Feb 16, 2025 — with Lablup-Issue-Syncer · 0 comments · May be fixed by #3714
Assignees

Comments

@fregataa
Copy link
Member

fregataa commented Feb 16, 2025

Motivation  

In version 25.02, we introduced the ai.backend.common.api_handlers module to standardize HTTP API handler functions. However, the module has several issues that need to be addressed:

  • The name of a generic type variable T does not follow Python naming conventions
  • The _parse_and_execute_handler() function only accepts ai.backend.common.APIResponse objects
  • The module does not support aiohttp.web.StreamResponse as a return type for API handlers, despite aiohttp.web.Response being a subclass of StreamResponse
  • The type checking implementation for API handler responses is incorrect
  • API handler signatures are validated at runtime when handling requests, rather than during static analysis or server initialization
  • Even when the request is valid, an 'Invalid parameter' error may be raised if the API handler is incorrectly defined.
@fregataa fregataa self-assigned this Feb 16, 2025
@fregataa fregataa linked a pull request Feb 16, 2025 that will close this issue
2 tasks
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 a pull request may close this issue.

1 participant