-
Notifications
You must be signed in to change notification settings - Fork 193
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: Create meta-schema for Nextflow schema #2436
Labels
Comments
Ok, I had a stab at writing a first draft of this. Must be one of the most complicated schema that I've ever written 😵 Still missing:
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://nextflow.io",
"title": "Nextflow Schema Schema",
"description": "Meta-schema to validate Nextflow parameter schema files",
"type": "object",
"properties": {
"$schema": {
"title": "schema",
"type": "string",
},
"$id": {
"title": "ID URI",
"type": "string",
},
"title": {
"title": "Title",
"type": "string",
},
"description": {
"title": "Description",
"type": "string",
},
"type": {
"title": "Top level type",
"type": "string",
"const": "object"
},
"definitions": {
"title": "Parameter groups",
"type": "object",
"patternProperties": {
"^.*$": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"type": {
"const": "object"
},
"fa_icon": {
"type": "string",
"pattern": "^fa"
},
"description": {
"type": "string"
},
"required": {
"type": "array"
},
"properties": {
"type": "object",
"patternProperties": {
"^.*$": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["string", "boolean", "integer", "number"]
},
"format": {
"type": "string",
"enum": ["file-path", "directory-path", "path"]
},
"exists": {
"type": "boolean"
},
"mimetype": {
"type": "string",
"pattern": ".+/.+"
},
"pattern": {
"type": "string"
},
"schema": {
"type": "string"
},
"description": {
"type": "string"
},
"help_text": {
"type": "string"
},
"fa_icon": {
"type": "string",
"pattern": "^fa"
},
"errorMessage": {
"type": "string"
},
"hidden": {
"type": "boolean"
},
"minLength": {
"type": "integer"
},
"maxLength": {
"type": "integer"
},
"minimum": {
"type": "integer"
},
"maximum": {
"type": "integer"
}
}
}
}
}
}
}
}
},
"allOf": {
"title": "Combine definition groups",
"type": "array",
"items": {
"type": "object",
"properties": {
"$ref": {
"type": "string",
"pattern": "^#/definitions/"
}
}
}
},
}
} |
ewels
changed the title
Create meta-schema for Nextflow schema
Schema: Create meta-schema for Nextflow schema
Sep 28, 2023
ewels
added a commit
to nextflow-io/nf-validation
that referenced
this issue
Nov 17, 2023
Moved this to nextflow-io/nf-validation#133 and added in required fields + minimum string lengths. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the early days of the Nextflow schema files, I thought about making a "meta schema", but didn't do it as we were using off the shelf schema validation libraries. However, as the stack of 3rd party tools interacting with Nextflow schema has grown, it's become increasingly important to be explicit about what features and fields we do support, and what we don't.
Recently this led me to write a schema spec on the nf-validation plugin docs. I think a natural extension would be to also have a meta schema: a JSON schema document that describes the allowed structure of Nextflow schema. This should allow easy validation of schema files themselves, to ensure that they adhere to our restricted spec. And also include validation for our custom fields that we have added on top of the vanilla JSON schema spec.
The text was updated successfully, but these errors were encountered: