Skip to content

Find a referenced schema next to the schema that references it - #232

Merged
pinin4fjords merged 5 commits into
nextflow-io:masterfrom
pinin4fjords:fix/referenced-schema-path
Oct 2, 2026
Merged

pinin4fjords merged 5 commits into
nextflow-io:masterfrom
pinin4fjords:fix/referenced-schema-path

Conversation

@pinin4fjords

@pinin4fjords pinin4fjords commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #231

Use case

A pipeline can be included in another pipeline with pipeline composition (nextflow-io/nextflow#7213, ADR). The included pipeline calls validateParameters(parameters_schema: ...) with the path of its own schema, but the project that runs is the including pipeline. A schema referenced from its parameters schema with the schema keyword (for example the samplesheet schema of input) is only looked up relative to the running project, so it is not found. The same applies whenever a schema is read from a different directory than the project.

What changes

A schema named by the schema keyword is looked up next to the schema that references it first, and relative to the project otherwise, so existing pipelines are unaffected. Absolute paths are used as given.

The location of the schema is passed to JsonSchemaValidator.validate() by its callers (validateParameters, samplesheetToList, validate and the schema evaluator, so that a referenced schema can reference another schema next to itself).

Tests

In ValidateParametersTest, with the parameters schema in a temporary directory:

  • a samplesheet schema referenced by a relative path next to it is found and its errors are reported
  • a schema that is not next to it is found relative to the project
  • a schema referenced by a referenced schema is found next to the schema that references it

The full test suite passes.

Related

#230 (Channel and Value params) and #234 (nested command line values) are independent fixes for the same kind of pipeline. The CHANGELOG entries are in the same new section, so the second of them to merge needs a rebase.

pinin4fjords and others added 4 commits October 2, 2026 10:18
…ces it

A schema named by the 'schema' keyword was only looked up relative to the
project that runs. When the parameters schema belongs to another directory,
for example when a pipeline is included in another one, the referenced schema
was not found. The directory of the schema being validated is tried first,
then the project as before.

Fixes nextflow-io#231

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…renced schemas

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@nvnieuwk nvnieuwk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense! Thank you

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@pinin4fjords
pinin4fjords merged commit e24360c into nextflow-io:master Oct 2, 2026
5 checks passed
@pinin4fjords
pinin4fjords deleted the fix/referenced-schema-path branch October 2, 2026 17:47
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.

A schema referenced with the 'schema' keyword is only looked up relative to the running project

2 participants