Skip to content

Commit 67576a2

Browse files
authored
Merge pull request #311 from riscv-software-src/dev/kbroch/regex-ratif-date-change
restrict date regex to only valid months; fixes #310
2 parents 084ae98 + 66bdfc6 commit 67576a2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

schemas/ext_schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@
147147
},
148148
"ratification_date": {
149149
"oneOf": [
150-
{"type": "string", "pattern": "^20[0-9][0-9]-[0-9][0-9]$", "$comment": "When ratification date is known" },
150+
{"type": "string", "pattern": "^20[0-9][0-9]-(0[1-9]|1[0-2])$", "$comment": "When ratification date is known",
151+
"description": "A specific year and month in YYYY-MM format", "examples": ["2019-01", "2024-12"] },
151152
{"type": "string", "pattern": "^unknown$", "$comment": "When ratification date is unknown" },
152153
{"type": "null", "$comment": "When version isn't ratified" }
153154
]

schemas/schema_defs.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
"date": {
8181
"type": "string",
8282
"format": "date",
83-
"description": "A specific day in YYYY-MM-DD format, for example 2018-11-13"
83+
"description": "A specific day in YYYY-MM-DD format",
84+
"examples": ["2018-11-13", "2024-12-31"]
8485
},
8586
"extension_name": {
8687
"type": "string",
@@ -91,7 +92,7 @@
9192
},
9293
"requirement_string": {
9394
"type": "string",
94-
"pattern": "^((>=)|(>)|(~>)|(<)|(<=)|(=))\\s*[0-9]+(\\.[0-9]+(\\.[0-9]+(-[a-fA-F0-9]+)?)?)?$"
95+
"pattern": "^((>=)|(>)|(~>)|(<)|(<=)|(=))?\\s*[0-9]+(\\.[0-9]+(\\.[0-9]+(-[a-fA-F0-9]+)?)?)?$"
9596
},
9697
"version_requirements": {
9798
"description": "A (set of) version requirements",

0 commit comments

Comments
 (0)