openapi-core
openapi-core copied to clipboard
Improve error messages from error handlers
Discussed in https://github.com/python-openapi/openapi-core/discussions/757
Originally posted by jtherrmann January 11, 2024 All of the API endpoints for the test deployment of our Flask app, which is deployed via Amazon API Gateway, are currently returning a response like the one below:
{
"detail": "Server not found for https://vd2gh6uqw3.execute-api.us-west-2.amazonaws.com/api/user",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}
We depend on the latest pre-release of openapi-core
, https://github.com/python-openapi/openapi-core/releases/tag/0.19.0a1.
The error message leads me to believe that openapi-core
is raising a ServerNotFound
exception from BasePathFinder.find
(here), which is called from BaseAPICallValidator._find_path
(here).
I have a couple of questions:
- Is
BaseAPICallValidator
for validating requests, responses, or both? - Why does the validator need to validate the server URL? What exactly does
APICallPathFinder._get_servers_iter
do? What is the fundamental meaning of aServerNotFound
exception?