[Feature]: Provide error details (validation text, path)

Aperta
#899 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
32/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

Start by locating the current ValidationError and its child classes, then compare their available details with the behavior in previous versions. Determine how validation text and the failing path should be exposed, whether they are logged or returned, and define tests that confirm the chosen error behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

kind/enhancement
Suggested Behavior

The ValidationError (why is it a dataclass btw?) and it's child classes don't provide any details of:

  • What actually failed (ie. what was the error message, like Failed validating 'oneOf' in schema or Failed validating 'minLength=3)
  • The path which failed (e.g. foo.bar.array[1].some.nested.field)

These details used to be available in previous versions, but now the error text is very plain, just Request body validation error and such.

Why is this needed?

To log the details, for easier debugging/understanding.

Or, maybe even return them to the caller, so they can understand why the API is not accepting their request.

References

No response

Would you like to implement a feature?

None

Lingua principale
Python
Stelle
368
Fork
140
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python-openapi/openapi-core

Tutte le issue di python-openapi/openapi-core

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.