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

Schema: Support anyOf, allOf and oneOf #2427

Open
7 tasks
Tracked by #2429
ewels opened this issue Sep 21, 2023 · 0 comments
Open
7 tasks
Tracked by #2429

Schema: Support anyOf, allOf and oneOf #2427

ewels opened this issue Sep 21, 2023 · 0 comments
Labels

Comments

@ewels
Copy link
Member

ewels commented Sep 21, 2023

Description of feature

It's fairly common for parameters to be able to accept one of several input types. For example:

  • Either a specific string, or a number (auto or a float number between 0-1)
  • An --input flag can support inputs with multiple sample sheet schema

JSON Schema can natively support this kind of thing using anyOf. For example usage, see this ONT workflow schema.

More complex rules can be used with nested allOf and oneOf statements, eg. as done here .

Editing the Nextflow schema manually mostly works - validation within the pipeline uses off-the-shelf JSON schema libraries, so validation passes. However, our custom stack built on top of the Nextflow schema breaks horribly.

It would be good to explicitly support this behaviour. As with all schema extensions, this is across multiple locations:

  • nf-core schema build
  • nf-core schema lint
  • The web schema build UI
  • nf-core launch
  • The nf-core web launch UI & validation code
  • Pipeline template validation code (nextflow run ... )
  • Pipeline template help text (nextflow run ... --help)

This is an overview issue and each part of the above should be broken into its own issue / task.

@ewels ewels added the schema label Sep 21, 2023
@ewels ewels changed the title Schema: Support anyOf Schema: Support anyOf Sep 21, 2023
@ewels ewels changed the title Schema: Support anyOf Schema: Support anyOf and allOf Nov 17, 2023
@ewels ewels changed the title Schema: Support anyOf and allOf Schema: Support anyOf, allOf and oneOf Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant