-
Notifications
You must be signed in to change notification settings - Fork 21
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
Update meta schema #30
base: master
Are you sure you want to change the base?
Changes from 1 commit
512fc54
5add093
b048bfe
7393008
0133280
4bf250a
924ff34
b048276
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,15 @@ | |
"required": { | ||
"type": "array" | ||
}, | ||
"dependentRequired": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "array", | ||
"items": { "type": "string" }, | ||
"uniqueItems": true, | ||
"default": [] | ||
} | ||
}, | ||
"properties": { | ||
"type": "object", | ||
"patternProperties": { | ||
|
@@ -69,12 +78,44 @@ | |
], | ||
"properties": { | ||
"type": { | ||
"type": "string", | ||
"enum": ["string", "boolean", "integer", "number"] | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/$defs/typeAnnotation" | ||
}, | ||
{ | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/$defs/typeAnnotation" | ||
} | ||
} | ||
] | ||
}, | ||
"format": { | ||
"type": "string", | ||
"enum": ["file-path", "directory-path", "path", "file-path-pattern"] | ||
"enum": [ | ||
"file-path", | ||
"directory-path", | ||
"path", | ||
"file-path-pattern", | ||
"date-time", | ||
"date", | ||
"time", | ||
"duration", | ||
"email", | ||
"idn-email", | ||
"hostname", | ||
"id-hostname", | ||
"ipv4", | ||
"ipv6", | ||
"uuid", | ||
"uri", | ||
"uri-reference", | ||
"iri", | ||
"iri-reference", | ||
"uri-template", | ||
"json-pointer", | ||
"regex" | ||
] | ||
}, | ||
"exists": { | ||
"type": "boolean" | ||
|
@@ -85,6 +126,7 @@ | |
}, | ||
"pattern": { | ||
"type": "string", | ||
"format": "regex", | ||
"minLength": 1 | ||
}, | ||
"schema": { | ||
|
@@ -105,20 +147,51 @@ | |
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"default": { | ||
"$ref": "#/$def/allTypes" | ||
}, | ||
"examples": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/$def/allTypes" | ||
} | ||
}, | ||
"deprecated": { | ||
"type": "boolean" | ||
}, | ||
"hidden": { | ||
"type": "boolean" | ||
}, | ||
"minLength": { | ||
"type": "integer" | ||
"$ref": "#/$def/nonNegativeInteger" | ||
}, | ||
"maxLength": { | ||
"type": "integer" | ||
"$ref": "#/$def/nonNegativeInteger" | ||
}, | ||
"minimum": { | ||
"type": "integer" | ||
"type": "number" | ||
}, | ||
"exclusiveMinimum": { | ||
"type": "number" | ||
}, | ||
"maximum": { | ||
"type": "integer" | ||
"type": "number" | ||
}, | ||
"exclusiveMaximum": { | ||
"type": "number" | ||
}, | ||
"multipleOf": { | ||
"type": "number" | ||
}, | ||
"enum": { | ||
"type": "array", | ||
"uniqueItems": true, | ||
"items": { | ||
"$ref": "#/$def/allTypes" | ||
} | ||
}, | ||
"const": { | ||
"$ref": "#/$def/allTypes" | ||
} | ||
} | ||
} | ||
|
@@ -151,5 +224,24 @@ | |
"title", | ||
"description", | ||
"type" | ||
] | ||
], | ||
"$defs": { | ||
"typeAnnotation": { | ||
"type": "string", | ||
"enum": [ | ||
"string", | ||
"boolean", | ||
"integer", | ||
"number", | ||
"null" | ||
] | ||
}, | ||
"allTypes": { | ||
"type": ["integer", "boolean", "number", "string", "null"] | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How is this different to the one above? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The above one is a definition that states the value should be a string of one of these: "string", "boolean", "integer", "number" or "null". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha 👍🏻 Can you reference this above as well so that there's only one set, out of interest? I guess not as it needs a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I'm following what you mean here 😁 |
||
"nonNegativeInteger": { | ||
"type": "integer", | ||
"minimum": 0 | ||
} | ||
} | ||
} |
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.
I don't think that we do want all of these though.
Although JSON schema libraries can validate them, the launch form / schema builder / other tooling wouldn't know what to do with them.
Not sure that there's any point allowing them for validation if they will break other tooling. Any of these things can still be set as a string without
format
being set.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.
I'm not sure having the other tooling break on an unknown format is that great of an idea. Maybe they should just ignore the formats that are unknown. Some of these formats could be really useful for nextflow pipelines I think (
regex
,email
anduri
to name a few). Although I do agree that some don't make any sense to be in here.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.
If they're listed here then other tooling would accept the schema but then not know what to do with the
format
and either ignore it or break. So I'm suggesting slimming it down for the same reason 😅My expectation of how this will work is that tools will check the schema against the meta schema and show a warning if it fails. So for example:
It would then hopefully still continue to try to use the schema as best it can. Which I think is better than including them all, not knowing in advance, and then breaking.
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.
Okay so I think these make the most sense to keep:
Do you agree or should I also remove the ones that aren't built-in to the plugin?