RFC3339 year 0000 rejected by date-time format validation
Maintainer antworten meist innerhalb von 6 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
Rechercherichtung
Beginne mit der minimalen Reproduktion von validate(...) und vergleiche sie mit dem im Issue beschriebenen direkten Aufruf von rfc3339-validator. Verfolge, wie die Validierung des date-time-Formats diese Abhängigkeit erreicht, überprüfe dann das erwartete Ergebnis für 0000-01-01T00:00:00Z anhand von RFC3339 und dokumentiere oder teste das daraus resultierende Verhalten.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 5k
- Forks
- 741
- Ø Merge
- 4 T. 17 Std.
- Gemergte PRs (30 T.)
- 6
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus python-jsonschema/jsonschema
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
python-jsonschema/jsonschema#1610 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 6 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
python-jsonschema/jsonschema#1588 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 6 Tagen
-
Iterator error contexts lose parent links and absolute pathsEvtl. wieder frei @DawnofGenX hat das vor 59 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
python-jsonschema/jsonschema#1584 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 6 Tagen
-
regex format checker crashes with RecursionError on deeply nested patternsEvtl. vergeben @DawnofGenX hat das vor 59 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
python-jsonschema/jsonschema#1538 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 6 Tagen
-
is_duration raises an uncaught decimal.Overflow on a duration with a large exponentEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. OffenNeeds Test Upstream
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
python-jsonschema/jsonschema#1511 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 6 Tagen
Alle Issues in python-jsonschema/jsonschema
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
Techiebutler/freeframe#687 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug verbose GC
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
IBM/javacore-analyser#677 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
Maintainer antworten meist innerhalb von 2 Tagen
-
area/config comp/plugins P1 platform/qqbot tool/file type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
NousResearch/hermes-agent#163932 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
plugins/dsh: todayStr() computes UTC but is documented as local — journal entries written 00:00–08:00 local land in the previous day's fileEvtl. vergeben @Beehtrix hat das heute übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
zilliztech/memsearch#907 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag