Idea: detailed version-specific type annotations for `Schema`

Aberta
#91 1 comentário 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
25/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
python
Domínio
testing

Direção de pesquisa

Start by reading the linked Python typing discussion and the related jsonschema issues #766 and #778 to understand the proposed TypedDict approach and version-specific schema differences. The issue gives exclusiveMaximum as an example; a working implementation would provide static schema types that vary by draft version and could be considered for upstreaming.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

I recently saw https://github.com/python/typing/issues/182#issuecomment-899624078 proposing a nice trick for type-checking JSON data, and it occured to me that this could be extended to define version-specific Schema types using TypedDict. See also https://github.com/Julian/jsonschema/issues/766 and https://github.com/Julian/jsonschema/issues/778 - if we get a working implementation, this would probably be suitable for upstreaming.

For example, this would allow for static detection of exclusiveMaximum as either bool or int | float depending on the schema draft version.

Linguagem predominante
Python
Estrelas
281
Forks
35
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de python-jsonschema/hypothesis-jsonschema

Todas as issues de python-jsonschema/hypothesis-jsonschema

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.