ehn-dcc-development / eu-dcc-schema

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

Check relaxation of fn/fnt, gn/gnt #138

Closed dslmeinte closed 2 years ago

dslmeinte commented 2 years ago

The following text was prepared in the release notes for 1.3.1, but no corresponding change was made to the schema.

Rules around fn/fnt and gn/gnt have been relaxed. Now only one set must be provided. This supports cultures who only have given names and cultures who only have family names.

ryanbnl commented 2 years ago

We'll need to make a new release for this:

    "person_name": {
      "description": "Person name: Surname(s), forename(s) - in that order",
      "required": [
        "fnt"
      ]

Should be:

    "person_name": {
      "description": "Person name: Surname(s), forename(s) - in that order"

Or even better - if we can express in JSON Schema that either fnt or gnt are required.

dslmeinte commented 2 years ago

I think it should be expressed in the JSON Schema, and the documentation needs to be aligned with the guidelines.

ryanbnl commented 2 years ago

Agreed - if it can be expressed, then it should be.

The If..Then..Else construct should allow it to be expressed:

https://json-schema.org/understanding-json-schema/reference/conditionals.html

lari-kannisto commented 2 years ago

We'll need to make a new release for this:

"person_name": {
"description": "Person name: Surname(s), forename(s) - in that order",
"required": [
"fnt"
]

Should be:

"person_name": {
"description": "Person name: Surname(s), forename(s) - in that order"

Or even better - if we can express in JSON Schema that either fnt or gnt are required.

Hi!

I think the following should work:

    "person_name": {
      "description": "Person name: Surname(s), forename(s) - in that order",
      "anyOf":[
        {"required": [
        "fnt"
      ]},
        {"required": [
        "gnt"
      ]}
      ],
      "type": "object",
      "properties": {
        "fn": {
           ...
       }
dslmeinte commented 2 years ago

(issue is targeted by PR #139)

ryanbnl commented 2 years ago

(renamed the branch so the PR changed to #141

dslmeinte commented 2 years ago

Solved by PR #141