You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Loculus Helm Chart values.yaml JSON schema is not correctly validating additional properties in the metadata definition. When adding a new property includeInDownloadsByDefault to a metadata field, the schema validation did not catch this addition as an error, even though it wasn't defined in the schema.
Root Cause
The metadata definition in the schema is missing the additionalProperties: false constraint. Without this constraint, JSON Schema validation allows any additional properties not explicitly defined in the schema, which can lead to silent additions of unintended properties.
Current Behavior
metadata:
- name: sampleCollectionDatedisplayName: Collection dateheader: Sample detailsingest: ncbiCollectionDateorder: 10includeInDownloadsByDefault: true # This property had not defined in the schema but was acceptedpreprocessing:
function: parse_date_into_rangeinputs: ...
The above configuration is accepted by the schema validator even though includeInDownloadsByDefault wasn't defined in the schema.
Expected Behavior
The schema should reject any undefined properties until they are properly added to the schema definition. This would ensure consistent configuration and prevent typos or misunderstandings.
Proposed Solution
Add additionalProperties: false to the metadata definition in the schema:
"metadata": {
"type": "object",
"additionalProperties": false", // Add this line"properties": {
// existing properties"includeInDownloadsByDefault": {
"groups": ["metadata"],
"type": "boolean",
"description": "Whether this field should be included in data downloads by default."
}
},
"required": ["name"]
}
Impact
This change would make the schema more strict and help prevent silent additions of unintended properties, improving the reliability of configurations and making schema errors more discoverable.
Related
Note that other sections like ingest already have additionalProperties: false constraints which work properly to prevent undefined properties.
The text was updated successfully, but these errors were encountered:
Metadata Schema Missing additionalProperties: false Constraint
Issue Description
The Loculus Helm Chart values.yaml JSON schema is not correctly validating additional properties in the metadata definition. When adding a new property
includeInDownloadsByDefault
to a metadata field, the schema validation did not catch this addition as an error, even though it wasn't defined in the schema.Root Cause
The
metadata
definition in the schema is missing theadditionalProperties: false
constraint. Without this constraint, JSON Schema validation allows any additional properties not explicitly defined in the schema, which can lead to silent additions of unintended properties.Current Behavior
The above configuration is accepted by the schema validator even though
includeInDownloadsByDefault
wasn't defined in the schema.Expected Behavior
The schema should reject any undefined properties until they are properly added to the schema definition. This would ensure consistent configuration and prevent typos or misunderstandings.
Proposed Solution
Add
additionalProperties: false
to the metadata definition in the schema:Impact
This change would make the schema more strict and help prevent silent additions of unintended properties, improving the reliability of configurations and making schema errors more discoverable.
Related
Note that other sections like
ingest
already haveadditionalProperties: false
constraints which work properly to prevent undefined properties.The text was updated successfully, but these errors were encountered: