Support recursive references
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Start by reading the reference resolution and schema generation entry points named in the issue: resolve_all_refs(), canonicalish(), and from_schema(). Explore how they handle non-recursive references and review the suggested use of Hypothesis's st.deferred() strategy. Done means recursive and mutually recursive references generate valid data, while non-recursive references retain useful introspection and avoid unnecessary deferred strategies.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Take for example the following schema:
{
"person": {
"type": "object",
"properties": {
"name": {"type": "string"},
"parents": {
"type": "array",
"maxItems": 2,
"items": {"$ref": "#/person"}
}
}
},
"$ref": "#/person"
}
So we need to generate a person, who has 0-2 parents, each of whom is also a person. More complicated situations with several mutually-recursive objects are also possible, of course. Currently such cases will fail a RecursionError as we make no attempt to handle them!
Conceptually these are all easy enough to handle with the st.deferred() strategy... which is the extent of the good news. Some complications:
- We want to avoid using
st.deferred()when we don't actually need to, as it makes introspection (including e.g. error messages!) much less helpful, and adds some performance overhead (small but rarely needed). resolve_all_refs()can still resolve all non-recursive references in place, but will need to track which references have been traversed to avoid cycles.canonicalish()can still discard all non-functional keys, so long as it tracks which keys are reference targets. We can also re-write these to a standard location such as#/definitions/*.from_schema()can then switch into "deferred mode" if and only if there is a#/definitionspart of the schema after canonicalising.
This is all basically managable, but it's also going to be a lot of work that I just don't have capacity to do for free. Pull requests and/or funding welcome, but otherwise expect this issue to stay open.
- Lingua principale
- Python
- Stelle
- 281
- Fork
- 35
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
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/hypothesis-jsonschema
-
Missing test files in Pypi releaseForse già presa @blouirts123 l’ha presa 49 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
-
Shouldn't PKG-INFO Homepage point to https://github.com/python-jsonschema/hypothesis-jsonschema ?Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 58/100
python-jsonschema/hypothesis-jsonschema#114 · 1 commento ·
-
Push release tags to github?Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 55/100
python-jsonschema/hypothesis-jsonschema#113 · 1 reazione ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
python-jsonschema/hypothesis-jsonschema#104 · 3 reazioni ·
Tutte le issue di python-jsonschema/hypothesis-jsonschema
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
web-push-libs/pywebpush#216 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AgriciDaniel/claude-seo#572 ·
I maintainer di solito rispondono entro 5 giorni
-
area:print-dispatch
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
area: docs domain: technical-writing good first issue type: documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
Deepak3699/Ai_Mentor#919 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno