Skip to content

ext-rrid field type fails validation when optional and left empty #1011

@ree-gupta

Description

@ree-gupta

When using the ext-rrid input type with requiredValue: false, leaving the field empty causes a validation error:

{
  "message": "object instance has properties which are not allowed by the schema: ['@value']",
  "location": "/strain",
  "additionalInfo": {
    "schemaFile": "#",
    "schemaPointer": "/properties/strain"
  }
}

Expected behavior:

An optional ext-rrid field left empty should validate successfully.

Actual behavior:

CEDAR outputs {"@value": null} for empty ext-rrid fields, but the generated schema only allows @type, rdfs:label, and @id properties. With additionalProperties: false, this causes validation failure.

Use case:

In our neurophysiology metadata template, strain uses ext-rrid to capture RRID identifiers for animal strains. However, strain is not applicable for all species (e.g., non-human primates, human subjects), so the field must be optional.

Is ext-rrid designed to be used only with required fields? If so, could this be documented? If not, could the generated schema include @value to handle the empty case?

PS: The RRID lookup returns mixed-quality results - qualified RRIDs (e.g., IMSR_JAX:000664) resolve correctly, but some unqualified entries (e.g., RRID:3028467) do not resolve. This may be upstream data quality, but users have no way to distinguish reliable entries in the UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions