Closed cookeac closed 2 years ago
Having tested this in https://regex101.com/ there are three effective captures:
([0-9]{4})
- four digits (anything from 0000 to 9999 but effectively designed as year)([0-9]{4}-[0-9]{2})
- four digits, a dash, and 2 digits. Intended to represent YYYY-MM but as you say it does allow for 9999-99. I will make a change to allow 00 to 19 for months (because more than that makes the regex complex).([0-9]{4}-[0-9]{2}-[0-9]{1,2}(Z?)(\/|--)[0-9]{4}-[0-9]{2}-[0-9]{1,2}(Z?)))
- intended to be YYYY-MM-DDZ/YYYY-MM-DDZ
The Zs are optional (indicated by the question mark after them), but we could remove them completely. The only optionality then is whether you have a / or -- symbol. The latter is an alternative more suited to some operating systems.So I think the optionality is right, but would be willing to accept corrections :-) The remaining questions are:
birthPeriod was previously specified as an icarDateType, which is half-right, because it is a date range. Most validators interpret "format": "date" as an RFC3339 date, which does not allow for ranges.
Instead I have changed its type to string, and defined a pattern with a regex. If this is too complex we can ditch the regex and simply make it a string with the current description.