Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nf-core schema build uses old schema in json file #3030

Closed
SimonDMurray opened this issue Jun 20, 2024 · 2 comments
Closed

nf-core schema build uses old schema in json file #3030

SimonDMurray opened this issue Jun 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@SimonDMurray
Copy link

Description of the bug

When building a nextflow_schema.json with the command nf-core schema build the produced .json file has the line:
"$schema": "http://json-schema.org/draft-07/schema", which causes a pipeline using nf-schema to fail.
The line should be:
"$schema":"https://json-schema.org/draft/2020-12/schema",

Command used and terminal output

Command line error:
root@f90c924640fe:/# nextflow run main.nf 

 N E X T F L O W   ~  version 24.04.2

Launching `main.nf` [awesome_becquerel] DSL2 - revision: 2cc5bcc25d

ERROR ~ Failed to load the meta schema:
    The used schema draft (http://json-schema.org/draft-07/schema) is not correct, please use "https://json-schema.org/draft/2020-12/schema" instead.
        - If you are a pipeline developer, check our migration guide for more information: https://nextflow-io.github.io/nf-schema/latest/migration_guide/
        - If you are a pipeline user, pin the previous version of the plugin (1.1.3) to avoid this error: https://www.nextflow.io/docs/latest/plugins.html#using-plugins, i.e. set `plugins {
    id 'nf-validation@1.1.3'
}` in your `nextflow.config` file
            

 -- Check '.nextflow.log' file for details

main.nf file:

include { validateParameters; paramsHelp; paramsSummaryLog; samplesheetToList } from 'plugin/nf-schema'

process FOO {

  input:
  val(x)

  output:
  path('x.txt')

  script:
  """
  echo $x > x.txt
  """
}

process BAR {

  input:
  path(x)

  script:
  """
  cat $x
  """
}

workflow {

  // Print help message, supply typical command line usage for the pipeline
  if (params.help) {
     log.info paramsHelp("nextflow run main.nf")
     exit 0
  }

  // Validate input parameters
  validateParameters()

  // Print summary of supplied parameters
  log.info paramsSummaryLog(workflow)

  //Create empty channel that container versions will go into
  ch_containers = Channel.empty()

  ch_ab = Channel.of(params.a, params.b)

  FOO(ch_ab) | BAR

}

nextflow.config file:

params {
  a = "a"
  b = "b"
  help = null
}

plugins {
  id 'nf-schema@2.0.0'
}

System information

I am using Nextflow version 24.04.2
I am using nf-core tolls version 2.14.1
I am using nf-schema plugin version 2.0.0

@SimonDMurray SimonDMurray added the bug Something isn't working label Jun 20, 2024
@mirpedrol
Copy link
Member

Hi @SimonDMurray, thanks for reporting this!
It is a known issue. We are tracking all the work that has to be done related to the schema with #2429

@SimonDMurray
Copy link
Author

ok! i had a look in previous issues but couldn't find it. Need to improve my search skills 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants