Decision records · Value formats
D-001 Which written form does an ISO 8601 point in time or duration take?
What the schemas do
The RFC 3339 forms that JSON Schema names as formats. Every point in time is a date-time with a required UTC offset. A length of time is a duration in the ISO 8601 grammar of RFC 3339 Appendix A.
Options
Why
ISO 8601 allows many representations of one instant, and a local time without an offset names no instant at all, so two parties can't compare valid_until or hold_expires_at without agreeing on more. RFC 3339 is the internet profile of ISO 8601. It requires an offset and has one extended form, and JSON Schema's date-time and duration formats name it exactly, so standard validators check it without a custom pattern. The § 3.2 "date range" bounds are ranges of these points in time.
What we ask the specification to state
Name RFC 3339 instead of ISO 8601. Every point in time is an RFC 3339 date-time with a UTC offset. Durations follow the ISO 8601 duration grammar in RFC 3339 Appendix A.
The specification lines it rests on
Each line is quoted as the record pins it. Expand an item to read the quote.
main
§ 4.1, the
valid_fromandvalid_untilrow L190 at 44dfaafvalid_from·valid_until| Timestamp | seller-set | ISO-8601 window the offer holds. This is the offer window, not the campaign flight§ 5.6.2, the
hold_status.hold_expires_atkey row L310 at 44dfaafhold_expires_at| Absolute timestamp, set when the hold is granted§ 5.6.2, the
hold_status.hold_durationkey row L307 at 44dfaafhold_duration| ISO-8601 duration the hold runs for§ 3.2, a requirement L158 at 44dfaaf
Every field marked
settableMUST declare its bounds: eitherallowed[](an enumerated set) ormin/max(a numeric or date range).
With the open PRs
§ 4.1, the
valid_fromandvalid_untilrow L183 on main at 981a74evalid_from·valid_until| Timestamp | seller-set | ISO-8601 window the offer holds. This is the offer window, not the campaign flight§ 5.6.2, the
hold_status.hold_expires_atkey row L303 on main at 981a74ehold_expires_at| Absolute timestamp, set when the hold is granted§ 5.6.2, the
hold_status.hold_durationkey row L300 on main at 981a74ehold_duration| ISO-8601 duration the hold runs for§ 3.2, a requirement L151 on main at 981a74e
Every field marked
settableMUST declare its bounds: eitherallowed[](an enumerated set) ormin/max(a numeric or date range).
What it shapes
main: Duration, Timestamp, HoldStatus.hold_duration, HoldStatus.hold_expires_at, Proposal.valid_from, Proposal.valid_until
With the open PRs: Duration, Timestamp, HoldStatus.hold_duration, HoldStatus.hold_expires_at, Proposal.valid_from, Proposal.valid_until