Skip to content

Commit 3551097

Browse files
committed
Support date and time, and allow for more RFC 3339
This addresses json-schema-org#199 by supporting the two least controversial and most requested addtional date/time formats, and reserving the remaining namespace while we decide whether or how to specify additional RFC 3339 formats.
1 parent 0f22800 commit 3551097

File tree

1 file changed

+40
-6
lines changed

1 file changed

+40
-6
lines changed

jsonschema-validation.xml

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -799,14 +799,48 @@
799799

800800
<section title="Defined formats">
801801

802-
<section title="date-time">
803-
<t>
804-
This attribute applies to string instances.
802+
<section title="Dates and times">
803+
<t>
804+
These attributes apply to string instances.
805+
</t>
806+
<t>
807+
Date and time format names are derived from
808+
<xref target="RFC3339">RFC 3339, section 5.6</xref>.
809+
</t>
810+
<t>
811+
Implementations supporting formats SHOULD implement support for
812+
the following attributes:
813+
<list style="hanging">
814+
<t hangText="date-time">
815+
A string instance is valid against this attribute if it is
816+
a valid representation according to the "date-time" production.
817+
</t>
818+
<t hangText="date">
819+
A string instance is valid against this attribute if it is
820+
a valid representation according to the "full-date" production.
821+
</t>
822+
<t hangText="time">
823+
A string instance is valid against this attribute if it is
824+
a valid representation according to the "full-time" production.
825+
</t>
826+
</list>
805827
</t>
806828
<t>
807-
A string instance is valid against this attribute if it is a valid date
808-
representation as defined by <xref target="RFC3339">RFC 3339, section
809-
5.6</xref>.
829+
Implementations MAY support additional attributes using the other
830+
production names defined in that section. If implementing
831+
"full-date" or "full-time", the corresponding short form ("date"
832+
or "time" respectively) MUST be implemented, and MUST behave
833+
identically. Implementations SHOULD NOT define extension attributes
834+
with any name matching an RFC 3339 production unless it validates
835+
according to the rules of that production.
836+
<cref>
837+
There is not currently consensus on the need for supporting
838+
all RFC 3339 formats, so this approach of reserving the
839+
namespace will encourage experimentation without committing
840+
to the entire set. Either the format implementation requirements
841+
will become more flexible in general, or these will likely
842+
either be promoted to fully specified attributes or dropped.
843+
</cref>
810844
</t>
811845
</section>
812846

0 commit comments

Comments
 (0)