Jim Downie
12/16/2025, 2:19 PMid, pacbio_hifi, oxford_nanopore, illumina_hic and illumina_10x. How can I specify that id and at least /one/ of the other sections must be specified for an entry to be valid?
{
"$schema": "<https://json-schema.org/draft/2020-12/schema>",
"$id": "<https://raw.githubusercontent.com/test/test/master/assets/schema_input.json>",
"title": "Test schema for samplesheets",
"description": "Schema for the file provided with params.data_input",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
},
"pacbio_hifi": {
"type": "object",
"properties": {
},
"required": ["reads"]
},
"oxford_nanopore": {
"type": "object",
"properties": {
},
"required": ["reads"]
},
"illumina_hic": {
"type": "object",
"properties": {
},
"required": ["reads"]
},
"illumina_10x": {
"type": "object",
"properties": {
},
"required": ["reads"]
}
}
}
}Nicolas Vannieuwkerke
12/16/2025, 2:20 PM"required": ["id"] in the items scope for thatJim Downie
12/16/2025, 2:21 PMid would be valid - but I want to enforce specification of at least one other fieldNicolas Vannieuwkerke
12/16/2025, 2:22 PM"anyOf": [
{"required": ["pacbio_hifi"]},
...
]
Where ... is a repeat of the required section above with another field 😛Nicolas Vannieuwkerke
12/16/2025, 2:22 PMJim Downie
12/16/2025, 2:24 PMNicolas Vannieuwkerke
12/16/2025, 2:24 PMJim Downie
12/16/2025, 2:26 PMNicolas Vannieuwkerke
12/16/2025, 2:28 PMJim Downie
12/16/2025, 2:28 PMNicolas Vannieuwkerke
12/16/2025, 2:29 PMJim Downie
12/16/2025, 3:55 PM"anyOf": [
{
"dependentRequired": {
"maternal_illumina_dataset": ["paternal_illumina_dataset"]
}
},
{
"dependentRequired": {
"paternal_illumina_dataset": ["maternal_illumina_dataset"]
}
}
]
Is that the right way to specify a reciprocal optional dependency?Nicolas Vannieuwkerke
12/16/2025, 4:19 PM"dependentRequired": {
"paternal_illumina_dataset": ["maternal_illumina_dataset"],
"maternal_illumina_dataset": ["paternal_illumina_dataset"]
}
Is enough here, but it does exactly the same as your codeJim Downie
12/16/2025, 4:22 PMPhil Ewels
12/16/2025, 5:26 PMPhil Ewels
12/16/2025, 5:26 PMPhil Ewels
12/16/2025, 5:26 PMNicolas Vannieuwkerke
12/16/2025, 5:30 PMJim Downie
12/16/2025, 6:23 PMPhil Ewels
12/17/2025, 4:43 AM