@stencila/schema
Version:
Extensions to schema.org to support semantic, composable, parameterize-able and executable documents
110 lines (109 loc) • 3.23 kB
JSON
{
"title": "Parameter",
"@id": "stencila:Parameter",
"extends": "Entity",
"role": "secondary",
"status": "experimental",
"category": "code",
"description": "A parameter of a document or function.",
"properties": {
"type": {
"@id": "schema:type",
"description": "The name of the type.",
"type": "string",
"enum": [
"Parameter"
],
"default": "Parameter",
"from": "Entity"
},
"id": {
"@id": "schema:id",
"description": "The identifier for this item.",
"type": "string",
"from": "Entity"
},
"meta": {
"@id": "stencila:meta",
"description": "Metadata associated with this item.",
"type": "object",
"from": "Entity"
},
"name": {
"@id": "schema:name",
"description": "The name of the parameter.",
"type": "string",
"pattern": "[a-z_][A-z0-9_]*",
"$comment": "This regex allows for snake_case and camelCase names but excludes\nPascalCase for names.\n",
"from": "Parameter"
},
"value": {
"@id": "schema:value",
"description": "The current value of the parameter.",
"allOf": [
{
"$ref": "Node.schema.json"
}
],
"from": "Parameter"
},
"default": {
"@id": "schema:defaultValue",
"description": "The default value of the parameter.",
"allOf": [
{
"$ref": "Node.schema.json"
}
],
"from": "Parameter"
},
"validator": {
"@id": "stencila:validator",
"description": "The validator that the value is validated against.",
"allOf": [
{
"$ref": "ValidatorTypes.schema.json"
}
],
"from": "Parameter"
},
"executeDigest": {
"@id": "stencila:executeDigest",
"description": "The SHA-256 digest of the `value` property the last time the node was executed.",
"type": "string",
"$comment": "Used to determine whether it is necessary to re-execute the node (i.e to assign a variable\nwithin the document session having `name` and `value`).\n",
"from": "Parameter"
},
"isRequired": {
"@id": "schema:valueRequired",
"description": "Is this parameter required, if not it should have a default or default is assumed to be null.",
"type": "boolean",
"from": "Parameter"
},
"isVariadic": {
"@id": "stencila:isVariadic",
"description": "Indicates that this parameter is variadic and can accept multiple arguments.",
"type": "boolean",
"from": "Parameter"
},
"isExtensible": {
"@id": "stencila:isExtensible",
"description": "Indicates that this parameter is variadic and can accept multiple named arguments.",
"type": "boolean",
"from": "Parameter"
}
},
"required": [
"type",
"name"
],
"file": "Parameter.schema.yaml",
"children": [],
"descendants": [],
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema.stenci.la/v1/Parameter.schema.json",
"source": "https://github.com/stencila/schema/blob/master/schema/Parameter.schema.yaml",
"type": "object",
"additionalProperties": false,
"propertyAliases": {}
}