Support recursive references
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 281
- Forks
- 35
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de python-jsonschema/hypothesis-jsonschema
-
Missing test files in Pypi releasePosiblemente ocupada @blouirts123 la tomó hace 49 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
-
Shouldn't PKG-INFO Homepage point to https://github.com/python-jsonschema/hypothesis-jsonschema ?Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 58/100
python-jsonschema/hypothesis-jsonschema#114 · 1 comentario ·
-
Push release tags to github?Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 55/100
python-jsonschema/hypothesis-jsonschema#113 · 1 reacción ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
python-jsonschema/hypothesis-jsonschema#104 · 3 reacciones ·
Todos los issues de python-jsonschema/hypothesis-jsonschema
Issues similares
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
web-push-libs/pywebpush#216 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AgriciDaniel/claude-seo#572 ·
Los mantenedores suelen responder en 5 días
-
area:print-dispatch
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
Los mantenedores suelen responder en 1 día
-
area: docs domain: technical-writing good first issue type: documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Deepak3699/Ai_Mentor#919 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día