-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Describe the bug
User API responds with 400 HTTP status codes for invalid requests. These requests can be invalid on multiple layers though. They can be invalid based on checks that are done in implemented endpoint handlers but also based on schema validation. The schema validation issue reports are handled by connexion and differ from the ones that are implemented by us in the Python code. They do not conform to HTTP 400 schema that is declared on Python endpoints.
To Reproduce
Steps to reproduce the behavior:
- As an example, use a CLI tool to interact with API and ask for results on an endpoint but do not provide required input:
curl -X 'GET' \
'http://stage.thoth-station.ninja/api/v1/python/package/version/metadata?name=flask&version=0.12&index=https%3A%2F%2Fpypi.org%2Fsimple&os_version=8&python_version=3.8' \
-H 'accept: application/json'
{
"detail": "Missing query parameter 'os_name'",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
- See the response is not conforming to the OpenAPI spec
Expected behavior
The response should be conforming to the OpenAPI spec.
Additional context
I've tried to register a custom flask for 400 or providing a custom connexion validator. None of these worked though - I did not invest much time into this, but it might be nice to have.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status