RFC3339 year 0000 rejected by date-time format validation
Mantenedores costumam responder em até 6 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
Direção de pesquisa
Comece com a reprodução mínima de validate(...) e compare-a com a chamada direta a rfc3339-validator descrita na issue. Rastreie como a validação do formato date-time chega a essa dependência; em seguida, verifique o resultado esperado para 0000-01-01T00:00:00Z de acordo com a RFC3339 e documente ou teste o comportamento resultante.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary
Validation of the date-time format rejects timestamps containing year 0000, even though the RFC3339 grammar allows any four-digit year.
Example timestamp:
0000-01-01T00:00:00Z
Context
During interoperability testing of JSON Schema date-time format validation across multiple implementations, I observed that this value is accepted by several validators but rejected by python-jsonschema. Further investigation suggests the behavior originates from the rfc3339-validator dependency used internally for date-time checking.
Specification Reference
RFC3339 defines the year component using the following grammar:
date-fullyear = 4DIGIT
Reference:
https://www.rfc-editor.org/rfc/rfc3339
Because the grammar explicitly permits any four digits, the year 0000 is syntactically valid according to the RFC.
Minimal Reproduction
from jsonschema import validate
schema = {
"type": "string",
"format": "date-time"
}
validate("0000-01-01T00:00:00Z", schema)
Observed Behavior
The validator raises a ValidationError, indicating the instance is not considered a valid date-time.
Expected Behavior
The timestamp should be accepted as syntactically valid according to the RFC3339 grammar.
Cross-Implementation Observation
During interoperability testing:
- Hyperjump JSON Schema accepts the timestamp.
- jsonschema-rs accepts the timestamp.
- python-jsonschema rejects the timestamp when format validation is enabled.
- Direct calls to
rfc3339-validatoralso reject the timestamp.
This indicates that the behavior likely originates from the underlying RFC3339 validation library used by the Python stack.
Possible Cause
The underlying validation library appears to reject year 0000, possibly due to limitations in date parsing logic or assumptions about supported calendar ranges.
Question
Is this behavior intentional, or would it be preferable for date-time validation to align strictly with the RFC3339 grammar? If the limitation originates in the underlying dependency, clarification in documentation may help users understand the behavior.
- Linguagem predominante
- Python
- Estrelas
- 5k
- Forks
- 741
- Merge médio
- 4d 17h
- PRs com merge (30d)
- 6
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/jsonschema
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
python-jsonschema/jsonschema#1610 · 1 comentário ·
Mantenedores costumam responder em até 6 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
python-jsonschema/jsonschema#1588 · 2 comentários ·
Mantenedores costumam responder em até 6 dias
-
Iterator error contexts lose parent links and absolute pathsTalvez livre de novo @DawnofGenX assumiu há 59 dias e não há nenhum pull request aberto. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
python-jsonschema/jsonschema#1584 · 3 comentários ·
Mantenedores costumam responder em até 6 dias
-
regex format checker crashes with RecursionError on deeply nested patternsTalvez já em andamento @DawnofGenX assumiu há 59 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
python-jsonschema/jsonschema#1538 · 1 comentário ·
Mantenedores costumam responder em até 6 dias
-
is_duration raises an uncaught decimal.Overflow on a duration with a large exponentTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. AbertaNeeds Test Upstream
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
python-jsonschema/jsonschema#1511 · 1 comentário ·
Mantenedores costumam responder em até 6 dias
Todas as issues de python-jsonschema/jsonschema
Issues semelhantes
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
Techiebutler/freeframe#687 ·
Mantenedores costumam responder em até 1 dia
-
bug 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
-
area/config comp/plugins P1 platform/qqbot tool/file type/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
NousResearch/hermes-agent#163932 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
plugins/dsh: todayStr() computes UTC but is documented as local — journal entries written 00:00–08:00 local land in the previous day's fileTalvez já em andamento @Beehtrix assumiu hoje. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
zilliztech/memsearch#907 · 1 comentário ·
Mantenedores costumam responder em até 1 dia