Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds DUOS id field #1551

Merged
merged 8 commits into from
Mar 15, 2024
Merged

adds DUOS id field #1551

merged 8 commits into from
Mar 15, 2024

Conversation

idazucchi
Copy link
Collaborator

@idazucchi idazucchi commented Mar 8, 2024

Fixes #1550

Rationale

  1. The DUOS id should be required only if the project is managed access (data_use_restriction = GRU or GRU-NCU)
  2. If the project is open access (data_use_restriction = NRES ) DUOS_id should be forbidden. This way if a project is erroneously marked as open access we can’t export it with a DUOS id.

Implementation:

  1. The if block allows to conditionally require a field
  2. To make sure that DUOS_id is disallowed for open access projects it should be conditionally defined for data_use_restriction = GRU or GRU-NCU.
    This is not possible because additionalProperties is set to false, which means that any property not defined in the main property section will fail validation. Removing additionalProperties : false is not an option because then any undeclared property would also be valid.
    In draft 9 by the keyword unevaluatedProperties allows to define properties in subschemas, but we are using draft7 so this option is not available to us right now.
    The compromise I made is to require the length of the DUOS_id to be 0, so that if the data_use_restriction isn’t set correctly the schema will not validate.

Release notes

For type/project/project.json schema:

  • Adds DUOS_id field

@idazucchi idazucchi self-assigned this Mar 8, 2024
json_schema/type/project/project.json Outdated Show resolved Hide resolved
Copy link
Collaborator

@ESapenaVentura ESapenaVentura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@NoopDog NoopDog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 🚀

json_schema/type/project/project.json Outdated Show resolved Hide resolved
@idazucchi idazucchi merged commit 553c7c0 into staging Mar 15, 2024
3 of 5 checks passed
@idazucchi idazucchi deleted the iz-add-DUOS-id-Issue1550 branch March 15, 2024 11:49
@idazucchi idazucchi restored the iz-add-DUOS-id-Issue1550 branch March 15, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants