Skip to content

Fix manifest import rejecting valid metadata with non-'none' language keys#531

Open
cubap wants to merge 1 commit into
developmentfrom
530-manifest-import
Open

Fix manifest import rejecting valid metadata with non-'none' language keys#531
cubap wants to merge 1 commit into
developmentfrom
530-manifest-import

Conversation

@cubap

@cubap cubap commented Jun 15, 2026

Copy link
Copy Markdown
Member

Problem

The manifest import endpoint (POST /project/import?createFrom=URL) was rejecting valid IIIF manifests when metadata values used language tags other than "none".

Root Cause

validatePayload.js only accepted:

  1. Plain string values: { value: "John Doe" }
  2. Language maps with "none" key: { value: { "none": ["John Doe"] } }

Valid IIIF manifests can use any IETF language tag ("en", "fr", "la", etc.).

Changes

  • utilities/validatePayload.js — Added validateLanguageMap() and validateMetadataField() helpers to accept any IETF language tag in metadata label and value fields. Refactored duplicated label/value validation into a single parameterized helper.
  • test/local/utility.validation.test.js — Added 5 test cases covering non-"none" language tags, mixed formats, and invalid language maps.

Testing

All 14 local tests pass, including the 5 new metadata validation tests.

Related

@cubap cubap requested a review from thehabes as a code owner June 15, 2026 16:15
better handling during import of manifests if language maps have non-`none` objects.
@cubap cubap force-pushed the 530-manifest-import branch from d71c513 to 1dc2f4e Compare June 15, 2026 16:18
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.

1 participant