ehn-dcc-development / eu-dcc-schema

Schema for the ehn DCC payload
Apache License 2.0
164 stars 59 forks source link

Relax dob regex to check year only #74

Closed gabywh closed 3 years ago

gabywh commented 3 years ago

See #73

gabywh commented 3 years ago

From all the above comments, I see that some background domain knowledge is missing. As this is a more specialist area, I updated and expanded the original Issue description (https://github.com/ehn-digital-green-development/ehn-dgc-schema/issues/73#issue-895153271) to include more background, context and explanation.

ISO8601, JSON Schema and semver are already described elsewhere and I will not elaborate further on these here.

gabywh commented 3 years ago

Breaking change. I suggest 6aff8dd is reverted and put in to a separate PR for further discussion.

Please explain why you think this is a breaking change.

jschlyter commented 3 years ago

Breaking change. I suggest 6aff8dd is reverted and put in to a separate PR for further discussion.

Please explain why you think this is a breaking change.

To quote https://github.com/ehn-digital-green-development/ehn-dgc-schema/issues/73:

"The schema is a formal specification of the business rules and it is correct that the schema is not the arbiter. However, the schema is the technical control and changing the allowed syntax for property to a more permissive format is indeed a breaking change as validating a dob´ such as2011with schema 1.0.0 will fail. Following semver, it's fine to removeformat: date`, but we have to bump the major version.

Code generators use the JSON schema to generate their data model, and when they find format: date they interpret that as a ISO8601 date per RFC3339 (section 5.6, full-date). Trying to parse 2011 or 2021-05 with such code will fail.

We either move to schema v2 or continue to require a full date. I'm fine with either, but the change has to be done correctly."

jschlyter commented 3 years ago

Please set version to 1.1.0

jschlyter commented 3 years ago

If they support full ISO8601 then '2011' and '2011-05' should NOT fail.

Agreed, however note that RFC3339, per JSON schema date, is not full ISO8601.

gabywh commented 3 years ago

If they support full ISO8601 then '2011' and '2011-05' should NOT fail.

Agreed, however note that RFC3339, per JSON schema date, is not full ISO8601.

rfc3339 section 5.6:

The following profile of ISO 8601 [ISO8601] dates SHOULD be used [...] date-fullyear = 4DIGIT [etc]

also https://github.com/ehn-digital-green-development/ehn-dgc-schema/issues/73#issuecomment-845113203