Skip to content

Commit 3dd6683

Browse files
committed
schema: accommodate imprecise dates in the date field, supporting YYYY and YYYY-MM as well (#260)
1 parent 1e417f8 commit 3dd6683

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

schemas/game-schema-d4.json

+11-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,17 @@
7878
"format": "uri"
7979
},
8080
"date": {
81-
"type": "string",
82-
"format": "date",
83-
"description": "The date the entry was first released"
81+
"anyOf": [
82+
{
83+
"type": "string",
84+
"pattern": "^\\d{4}(-(0?[1-9]|1[0-2])(-(0?[1-9]|[12][0-9]|3[01]))?)?$"
85+
},
86+
{
87+
"type": "string",
88+
"format": "date"
89+
}
90+
],
91+
"description": "The date the entry was first released, expressed in ISO8601 format. To accommodate imprecise dates, the formats YYYY-MM (year and month) and YYYY (year only) are also supported"
8492
},
8593
"tags": {
8694
"type": "array",

0 commit comments

Comments
 (0)