Improve error messages from error handlers

Abierto
#787 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
aws, flask, python
Área
api, backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area/contrib
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 a ServerNotFound exception?
Lenguaje dominante
Python
Estrellas
368
Forks
140
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de python-openapi/openapi-core

Todos los issues de python-openapi/openapi-core

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.