nextflow-io / nextflow-io/nf-schema

Top level `validate` function broken for `Path` type schema signature

Open
#169 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Groovy
Stars
57
Forks
31
Avg merge
3d 17h
Merged PRs (30d)
1

Description

The top level ValidationExtension.validate method with the Path schema signature has no current tests but it is broken:

@Function
   List<String> validate(
       final Map options = [:],
       final Object input,
       final Path schema
   ) {
       return validate(input, schema.toUri(), options)
   }

options needs to be the first parameter. However this raises another issue as toUri returns a URI object and not a string.

When I then try to use toUri().toString() I get a failing test as the path seems to be improperly resolved:

/tmp/test8497693594181044640/file:/Users/arthurgymer/workbench/nf-core/nf-schema/src/testResources/nextflow_schema_nested_parameters.json

It seems that the tmpdir is being injected in front of the real path and this is breaking things. I am not sure if this is an issue isolated to the test framework. I am not sure how to resolve this and get a working test.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the top-level ValidationExtension.validate overload accepting a Path schema and inspect the existing validate overloads and test setup. Add coverage for the Path signature, checking both parameter ordering and URI/path resolution without the temporary directory being prepended. Done means the test passes for the referenced nested schema path.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.