Improve error messages from error handlers
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Read discussion 757 and trace BaseAPICallValidator._find_path into BasePathFinder.find and APICallPathFinder._get_servers_iter in openapi_core/validation/validators.py and openapi_core/templating/paths/finders.py. Use the ServerNotFound exception in openapi_core/templating/paths/exceptions.py as the starting point; done means the error-handler messages clearly explain the validation failure and its meaning.
Written by the indexing model from the issue text.
Description
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
BaseAPICallValidatorfor validating requests, responses, or both? - Why does the validator need to validate the server URL? What exactly does
APICallPathFinder._get_servers_iterdo? What is the fundamental meaning of aServerNotFoundexception?
- Dominant language
- Python
- Stars
- 368
- Forks
- 140
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python-openapi/openapi-core
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
python-openapi/openapi-core#1188 · 2 comments ·
-
kind/bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
python-openapi/openapi-core#1225 · 2 comments ·
-
kind/bug
Difficulty 3/5 1-2 days Newbie friendliness 76/100
python-openapi/openapi-core#1212 ·
-
[Bug]: Query parameter validation fails to match empty string when listed as a valid enum value Openkind/bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
python-openapi/openapi-core#1210 ·
-
kind/bug kind/bug/confirmed
Difficulty 3/5 1-2 days Newbie friendliness 58/100
python-openapi/openapi-core#1180 · 3 comments ·
All issues in python-openapi/openapi-core
Similar issues
-
sponsored
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Diaoul/subliminal#1382 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
triage/confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
agentscope-ai/agentscope#2775 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100