Skip to content

incorporate RFC 9557 time zone extension into 'date-time' format #1609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions specs/jsonschema-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,22 +397,24 @@ custom format values.
These attributes apply to string instances.

Date and time format names are derived from
[RFC 9557, section 4.1](https://www.rfc-editor.org/info/rfc9557) which extends
[RFC 3339, section 5.6](https://www.rfc-editor.org/info/rfc3339). The duration
format is from the ISO 8601 ABNF as given in Appendix A of RFC 3339.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
format is from the ISO 8601 ABNF as given in Appendix A of RFC 3339.
format is from ISO 8601 as formalized into ABNF by RFC 3339 Appendix A.


- *date-time*: A string instance is valid against this attribute if it is a
valid representation according to the "date-time" ABNF rule (referenced above)
valid representation according to the "date-time" ABNF rule in RFC 3339,
optionally with the "time-zone" rule in RFC 9557
Comment on lines +405 to +406
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This text is not clear to me... is the intent to allow a subset of the RFC 9557 grammar that includes time-zone but not suffix-tag? If so, I think that should be more explicit:

Suggested change
valid representation according to the "date-time" ABNF rule in RFC 3339,
optionally with the "time-zone" rule in RFC 9557
valid representation of the "date-time" ABNF rule in RFC 3339 or such a
string that is immediately followed by a valid representation of the
"time-zone" rule in RFC 9557

- *date*: A string instance is valid against this attribute if it is a valid
representation according to the "full-date" ABNF rule (referenced above)
representation according to the "full-date" ABNF rule in RFC 3339
- *time*: A string instance is valid against this attribute if it is a valid
representation according to the "full-time" ABNF rule (referenced above)
representation according to the "full-time" ABNF rule in RFC 3339
- *duration*: A string instance is valid against this attribute if it is a valid
representation according to the "duration" ABNF rule (referenced above)
representation according to the "duration" ABNF rule in ISO 8601
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ISO 8601 does not use ABNF, or have "rules" as such.

Suggested change
representation according to the "duration" ABNF rule in ISO 8601
representation according to the "duration" ABNF rule in RFC 3339 Appendix A


Implementations MAY support additional attributes using the other format names
defined anywhere in that RFC. Implementations SHOULD NOT define extension
attributes with any name matching an RFC 3339 format unless it validates
according to the rules of that format.[^5]
attributes with any name matching an RFC 3339, RFC 9557, or ISO 8601 format
unless it validates according to the rules of that format.[^5]

[^5]: There is not currently consensus on the need for supporting all RFC 3339
formats, so this approach of reserving the namespace will encourage
Expand Down
Loading