diff --git a/bids-validator/src/schema/applyRules.ts b/bids-validator/src/schema/applyRules.ts index c246e622d..39d3b69e9 100644 --- a/bids-validator/src/schema/applyRules.ts +++ b/bids-validator/src/schema/applyRules.ts @@ -31,7 +31,7 @@ export function applyRules( rootSchema = schema } if (!schemaPath) { - schemaPath = 'schema' + schemaPath = 'schema.rules' } Object.assign(context, expressionFunctions) // @ts-expect-error diff --git a/bids-validator/src/schema/context.ts b/bids-validator/src/schema/context.ts index 60e6f0a07..5303ce382 100644 --- a/bids-validator/src/schema/context.ts +++ b/bids-validator/src/schema/context.ts @@ -171,6 +171,7 @@ export class BIDSContext implements Context { if (this.extension !== '.tsv') { return } + this.columns = await this.file .text() .then((text) => parseTSV(text)) diff --git a/bids-validator/src/validators/filenameIdentify.ts b/bids-validator/src/validators/filenameIdentify.ts index 033e37b4e..3769ff553 100644 --- a/bids-validator/src/validators/filenameIdentify.ts +++ b/bids-validator/src/validators/filenameIdentify.ts @@ -35,6 +35,12 @@ export async function filenameIdentify(schema, context) { function findRuleMatches(schema, context) { const schemaPath = 'rules.files' Object.keys(schema[schemaPath]).map((key) => { + if ( + key == 'deriv' && + context.dataset.dataset_description.DatasetType != 'derivative' + ) { + return + } const path = `${schemaPath}.${key}` _findRuleMatches(schema[path], path, context) })