ajv-validator / ajv-validator/ajv

JTD: Support RFC9557 timestamp with time zone (IXDTF, extends RFC3339)

Aperta
#2,551 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
TypeScript
Stelle
14.8k
Fork
1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**What version of Ajv you are you using?**

8.17.1 (JSON Type Definition)

**What problem do you want to solve?**

Validate IXDTF timestamps which include time zone, per RFC9557.

**What do you think is the correct solution to problem?**

[RFC9557](https://datatracker.ietf.org/doc/rfc9557/) extends [RFC3339](https://datatracker.ietf.org/doc/rfc3339/) with optional time zone information; it would be useful for `ajv` to be able to parse IXDTF timestamps which include a suffixed time zone.

**Will you be able to implement it?**

No

**Further information**

npm install ajv
npm install ajv-cli

echo '{ "properties": { "ts": { "type": "timestamp" } } }' > schema.json
echo '{ "ts": "2025-07-01T12:34:00+01:00" }' > ts1.json
echo '{ "ts": "2025-07-01T12:34:00+01:00[Europe/London]" }' > ts2.json

ajv --spec=jtd -s schema.json -d ts1.json -d ts2.json

... results in

ts1.json valid
ts2.json invalid
[
{
instancePath: '/ts',
schemaPath: '/properties/ts/type',
keyword: 'type',
params: { type: 'timestamp', nullable: false },
message: 'must be timestamp'
}
]

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.