Support recursive references
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 25/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 281
- Forks
- 35
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de python-jsonschema/hypothesis-jsonschema
-
Missing test files in Pypi releaseTalvez já em andamento @blouirts123 assumiu há 49 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 35/100
-
Shouldn't PKG-INFO Homepage point to https://github.com/python-jsonschema/hypothesis-jsonschema ?Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 58/100
python-jsonschema/hypothesis-jsonschema#114 · 1 comentário ·
-
Push release tags to github?Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 55/100
python-jsonschema/hypothesis-jsonschema#113 · 1 reação ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 30/100
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 15/100
python-jsonschema/hypothesis-jsonschema#104 · 3 reações ·
Todas as issues de python-jsonschema/hypothesis-jsonschema
Issues semelhantes
-
accepted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
future-agi/future-agi#5908 ·
Mantenedores costumam responder em até 1 dia
-
Placeholder export disables HTML image input for picture descriptionTalvez já em andamento @cloudiful assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
docling-project/docling-serve#817 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
Techiebutler/freeframe#687 ·
Mantenedores costumam responder em até 1 dia
-
Parse truncated verbose GC logs up to the first XML errorTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertabug verbose GC
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
IBM/javacore-analyser#677 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
Mantenedores costumam responder em até 2 dias