Skip to content

Enforce data structure and data type consistency for JSON metadata#1421

Open
svogt0511 wants to merge 124 commits into
masterfrom
pb325-json-metadata-validation
Open

Enforce data structure and data type consistency for JSON metadata#1421
svogt0511 wants to merge 124 commits into
masterfrom
pb325-json-metadata-validation

Conversation

@svogt0511
Copy link
Copy Markdown
Contributor

@svogt0511 svogt0511 commented Oct 30, 2025

Purpose

closes: https://github.com/datacite/product-backlog/issues/325

Approach

See #1341 for the approach

Open Questions and Pre-Merge TODOs

Some notes:

  • A number of DOI fields are expected to be arrays of objects, but users will sometimes submit a request with an object instead of an array of one object. Lupo tries to correct this using Array.wrap, but not in every case. Consequently users can submit incorrect json data, but a DOI is still created because lupo corrects it. The json validations check for this situation and will report errors against this type of data if lupo has not already corrected the incoming data. Some of these fields are: ... Other's that flag the issue via json schema are: creators

Learning

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

  • New feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

Reviewer, please remember our guidelines:

  • Be humble in the language and feedback you give, ask don't tell.
  • Consider using positive language as opposed to neutral when offering feedback. This is to avoid the negative bias that can occur with neutral language appearing negative.
  • Offer suggestions on how to improve code e.g. simplification or expanding clarity.
  • Ensure you give reasons for the changes you are proposing.

Summary by CodeRabbit

  • New Features

    • Expanded JSON Schema coverage for DOI metadata (updated draft) with richer controlled vocabularies and new schema validations.
  • Refactor

    • Validation now resolves schemas dynamically and centralizes JSON-schema checks for many metadata fields.
  • Chore

    • Upgraded a JSON validation dependency to a newer version series.
  • Tests

    • Fixtures and specs adjusted to array-based metadata shapes and stricter validation/error expectations.

@svogt0511 svogt0511 self-assigned this Oct 30, 2025
svogt0511 added 30 commits March 5, 2026 13:39
…'uri' for uris, use long form of dependentRequired (if)
…, xml xs:anyURI, dependencyRequired (documentation 'suggestions' vs xsd.
…, xml xs:anyURI, dependencyRequired (documentation 'suggestions' vs xsd. Also, just use default minitems in the array of objects instead of explicitly specifying minitems: 0
…1 date ranges, and the standard vocab for unknown information do validate date fields (as is in our documentation).
…ts.json. (Breaks spec/requests/repositories_spec.rb:458 otherwise).
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.

4 participants