RFC3339 year 0000 rejected by date-time format validation
Les mainteneurs répondent en général sous 6 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
Piste de recherche
Commencez par la reproduction minimale de validate(...) et comparez-la à l’appel direct à rfc3339-validator décrit dans l’issue. Suivez la manière dont la validation du format date-time atteint cette dépendance, puis vérifiez le résultat attendu pour 0000-01-01T00:00:00Z conformément à RFC3339 et documentez ou testez le comportement qui en résulte.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 5k
- Forks
- 741
- Merge moyen
- 4 j 17 h
- PR mergées (30 j)
- 6
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de python-jsonschema/jsonschema
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
python-jsonschema/jsonschema#1610 · 1 commentaire ·
Les mainteneurs répondent en général sous 6 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
python-jsonschema/jsonschema#1588 · 2 commentaires ·
Les mainteneurs répondent en général sous 6 jours
-
Iterator error contexts lose parent links and absolute pathsPeut-être à nouveau libre @DawnofGenX l’a pris il y a 59 jours, et aucune pull request n’est ouverte. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
python-jsonschema/jsonschema#1584 · 3 commentaires ·
Les mainteneurs répondent en général sous 6 jours
-
regex format checker crashes with RecursionError on deeply nested patternsPeut-être pris @DawnofGenX l’a pris il y a 59 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
python-jsonschema/jsonschema#1538 · 1 commentaire ·
Les mainteneurs répondent en général sous 6 jours
-
is_duration raises an uncaught decimal.Overflow on a duration with a large exponentPeut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. OuverteNeeds Test Upstream
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
python-jsonschema/jsonschema#1511 · 1 commentaire ·
Les mainteneurs répondent en général sous 6 jours
Toutes les issues de python-jsonschema/jsonschema
Issues similaires
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
Techiebutler/freeframe#687 ·
Les mainteneurs répondent en général sous 1 jour
-
bug verbose GC
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
IBM/javacore-analyser#677 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 79/100
Les mainteneurs répondent en général sous 2 jours
-
area/config comp/plugins P1 platform/qqbot tool/file type/bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
NousResearch/hermes-agent#163932 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
plugins/dsh: todayStr() computes UTC but is documented as local — journal entries written 00:00–08:00 local land in the previous day's filePeut-être pris @Beehtrix l’a pris aujourd’hui. Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
zilliztech/memsearch#907 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour