Mutating validators are difficult to debug
Nessuno ha ancora preso questa issue.
- #1339 di @stephenfin — chiusa senza merge
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Esamina nova/api/validation/validators.py intorno alla riga 182 e il percorso di validazione di oneOf. Riproduci la mutazione con un validatore che elimina le chiavi, quindi usa i test per verificare che i controlli successivi dei sotto-schemi ricevano l’istanza originale; l’issue non specifica quale delle mitigazioni proposte dovrebbe essere accettata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I saw strange issues while adding schemas to a project I was working on. Despite knowing I was passing a valid instance in, I was getting errors like {} is not valid under any of the given schemas. I eventually traced this down to one of the in-tree validators (here, fwiw), which has the unfortunate side-effect of mutating the input instance. When the schema is using oneOf, the check against the first sub-schema ended up deleting all keys from the instance, causing the checks against subsequent sub-schemas to fail.
This is 100% not an issue with jsonschema but it is something I think it might be able to help mitigate. I could see us either (a) always doing a deepcopy of the instance before passing it to the validator, or (b) doing a deepcopy and comparing against instance after the call, with an exception raised if they're not identical. There might also be other approaches possible. In any case, I'm happy to help resolve this, assuming we agree it's a thing we'd like to address.
- Lingua principale
- Python
- Stelle
- 5k
- Fork
- 694
- Merge medio
- 1g 20h
- PR unite (30g)
- 6
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di python-jsonschema/jsonschema
-
Iterator error contexts lose parent links and absolute pathsForse già presa @DawnofGenX l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
python-jsonschema/jsonschema#1584 · 3 commenti ·
-
regex format checker crashes with RecursionError on deeply nested patternsForse già presa @DawnofGenX l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
python-jsonschema/jsonschema#1538 · 1 commento ·
-
is_duration raises an uncaught decimal.Overflow on a duration with a large exponentForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. ApertaNeeds Test Upstream
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
python-jsonschema/jsonschema#1511 · 1 commento ·
-
regex format checker crashes with ValueError on conflicting inline flagsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
python-jsonschema/jsonschema#1558 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
python-jsonschema/jsonschema#1547 ·
Tutte le issue di python-jsonschema/jsonschema
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
awslabs/visual-asset-management-system#414 ·
I maintainer di solito rispondono entro 1 giorno
-
bug v1 v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
modelcontextprotocol/python-sdk#3670 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
aicell-lab/bioengine#232 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
modelscope/evalscope#1836 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100