-
Notifications
You must be signed in to change notification settings - Fork 26
Add support for official Nextflow parameters meta schema #113
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
Draft
nvnieuwk
wants to merge
11
commits into
2.5.0dev
Choose a base branch
from
fix/parameters-schema
base: 2.5.0dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
415e905
add validation modes and support for the parameters meta schema
nvnieuwk cc59d62
Merge branch '2.4.0dev' into fix/parameters-schema
nvnieuwk aeab3ee
update changelog
nvnieuwk 360e2cb
make custom schema checker more flexible and extendable
nvnieuwk ced78b7
fix issue with a missing error message
nvnieuwk ae7ac9e
add tests
nvnieuwk 501fd15
update docs
nvnieuwk 1773ce4
remove old meta schema and reintroduce spaces in descriptions
nvnieuwk 8b708cb
remove the validation mode
nvnieuwk 7edebd8
Merge branch '2.4.0dev' into fix/parameters-schema
nvnieuwk f0aebfd
Merge branch '2.4.0dev' into fix/parameters-schema
nvnieuwk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
plugins/nf-schema/src/resources/schemas/parameters/1.0/parameters_meta_schema.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"$schema": "https://json-schema.org/draft/2020-12/schema","$id": "https://nextflow.io","title": "Nextflow Schema Meta-schema","description": "Meta-schema to validate Nextflow parameter schema files","type": "object","properties": {"$schema": {"title": "schema","type": "string","minLength": 1},"$id": {"title": "ID URI","type": "string","minLength": 1},"title": {"title": "Title","type": "string","minLength": 1},"description": {"title": "Description","type": "string","minLength": 1},"type": {"title": "Top level type","type": "string","const": "object"},"$defs": {"title": "Parameter groups","type": "object","patternProperties": {"^.*$": {"type": "object","required": ["title", "type", "properties"],"properties": {"title": {"type": "string","minLength": 1},"type": {"const": "object"},"fa_icon": {"type": "string","pattern": "^fa"},"description": {"type": "string"},"required": {"type": "array"},"properties": {"$ref": "#/$defs/parameterOptions"},"dependentRequired": {"type": "object","additionalProperties": {"type": "array","items": {"type": "string"},"uniqueItems": true,"default": []}}}}}},"properties": {"$ref": "#/$defs/parameterOptions"},"dependentRequired": {"type": "object","additionalProperties": {"type": "array","items": {"type": "string"},"uniqueItems": true,"default": []}},"allOf": {"title": "Combine definition groups","type": "array","items": {"type": "object","required": ["$ref"],"properties": {"$ref": {"type": "string","pattern": "^#/\\$defs/[^/]+$"}}}}},"required": ["$schema", "$id", "title", "description", "type"],"$defs": {"typeAnnotation": {"type": "string","enum": ["string", "boolean", "integer", "number", "null"]},"allTypes": {"type": ["integer", "boolean", "string", "number", "null"]},"nonNegativeInteger": {"type": "integer","minimum": 0},"parameterOptions": {"type": "object","patternProperties": {"^.*$": {"type": "object","allOf": [{ "$ref": "#/$defs/standardKeywords" },{ "$ref": "#/$defs/customKeywords" }],"required": ["type", "description"],"unevaluatedProperties": false}}},"standardKeywords": {"type": "object","description": "Allowed standard JSON Schema properties.","properties": {"type": {"description": "The type of the parameter value. Can be one or more of these: `['integer', 'boolean', 'number', 'string', 'null']`","anyOf": [{ "$ref": "#/$defs/typeAnnotation" },{"type": "array","items": { "$ref": "#/$defs/typeAnnotation" }}]},"format": {"type": "string","description": "The format of a parameter value with the 'string' type. This is used for additional validation on the structure of the value.","enum": ["file-path","directory-path","path","file-path-pattern","date-time","date","time","email","uri","regex"]},"pattern": {"type": "string","format": "regex","minLength": 1,"description": "Check a parameter value of 'string' type against a regex pattern"},"description": {"type": "string","description": "The description of the current parameter"},"default": {"$ref": "#/$defs/allTypes","description": "Specifies a default value to use for this parameter"},"examples": {"type": "array","items": {"$ref": "#/$defs/allTypes"},"description": "A list of examples for the current parameter"},"deprecated": {"type": "boolean","description": "States that the parameter is deprecated. Please provide a nice deprecation message using 'errorMessage'"},"minLength": {"$ref": "#/$defs/nonNegativeInteger","description": "The minimum length a 'string' parameter value should be"},"maxLength": {"$ref": "#/$defs/nonNegativeInteger","description": "The maximum length a 'string' parameter value should be"},"minimum": {"type": "number","description": "The mimimum value an 'integer' or 'number' parameter value should be"},"exclusiveMinimum": {"type": "number","description": "The exclusive mimimum value an 'integer' or 'number' parameter value should be"},"maximum": {"type": "number","description": "The maximum value an 'integer' or 'number' parameter value should be"},"exclusiveMaximum": {"type": "number","description": "The exclusive maximum value an 'integer' or 'number' parameter value should be"},"multipleOf": {"type": "number","description": "The 'integer' or 'number' parameter value should be a multiple of this value"},"enum": {"type": "array","uniqueItems": true,"items": {"$ref": "#/$defs/allTypes"},"description": "The parameter value should be one of the values specified in this enum array"},"const": {"$ref": "#/$defs/allTypes","description": "The parameter value should be equal to this value"}}},"customKeywords": {"type": "object","description": "Additional custom JSON Schema properties.","properties": {"errorMessage": {"type": "string","minLength": 1,"description": "NON STANDARD OPTION: The custom error message to display in case validation against this parameter fails. Can also be used as a deprecation message if 'deprecated' is true"},"exists": {"type": "boolean","description": "NON STANDARD OPTION: Check if a file exists. This parameter value needs to be a `string` type with one of these formats: `['path', 'file-path', 'directory-path', 'file-path-pattern']`"},"schema": {"type": "string","minLength": 1,"pattern": "\\.json$","description": "NON STANDARD OPTION: Check the given file against a schema passed to this keyword. Will only work when type is `string` and format is `path` or `file-path`"},"help_text": {"type": "string","description": "NON STANDARD OPTION: A more detailed help text"},"fa_icon": {"type": "string","pattern": "^fa","description": "NON STANDARD OPTION: A font awesome icon to use in the nf-core parameter documentation"},"hidden": {"type": "boolean","description": "NON STANDARD OPTION: Hide this parameter from the help message and documentation"},"mimetype": {"type": "string","description": "NON STANDARD OPTION: The MIME type of the parameter value","deprecated": true,"errorMessage": "The 'mimetype' keyword is deprecated. Use 'pattern' or 'format' instead."}},"dependentSchemas": {"exists": {"$comment": "This checks if the type is a 'string' and the format corresponds to a file or directory when 'exists' is used.","properties": {"type": { "const": "string" },"format": {"enum": ["path","file-path","file-path-pattern","directory-path"]}}},"schema": {"$comment": "This checks if the type is a 'string' and the format is 'path' or 'file-path'","properties": {"type": { "const": "string" },"format": {"enum": ["path", "file-path"]}}}}}}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has to be versioned surely?
main
will be a moving target.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's what the
TODO
statement is for :). I can't put a versioned URL there as it doesn't exist yet