1 | {
|
2 | "title": "Variable",
|
3 | "@id": "stencila:Variable",
|
4 | "extends": "Entity",
|
5 | "role": "secondary",
|
6 | "status": "unstable",
|
7 | "category": "code",
|
8 | "description": "A variable representing a name / value pair.",
|
9 | "properties": {
|
10 | "type": {
|
11 | "@id": "schema:type",
|
12 | "description": "The name of the type.",
|
13 | "type": "string",
|
14 | "enum": [
|
15 | "Variable",
|
16 | "Parameter"
|
17 | ],
|
18 | "default": "Variable",
|
19 | "from": "Entity"
|
20 | },
|
21 | "id": {
|
22 | "@id": "schema:id",
|
23 | "description": "The identifier for this item.",
|
24 | "type": "string",
|
25 | "from": "Entity"
|
26 | },
|
27 | "meta": {
|
28 | "@id": "stencila:meta",
|
29 | "description": "Metadata associated with this item.",
|
30 | "type": "object",
|
31 | "from": "Entity"
|
32 | },
|
33 | "name": {
|
34 | "@id": "schema:name",
|
35 | "description": "The name of the variable.",
|
36 | "type": "string",
|
37 | "pattern": "[a-z_][A-z0-9_]*",
|
38 | "$comment": "This regex allows for snake_case and camelCase names but excludes\nPascalCase for names.\n",
|
39 | "from": "Variable"
|
40 | },
|
41 | "isReadonly": {
|
42 | "@id": "schema:readonlyValue",
|
43 | "description": "Whether or not a property is mutable. Default is false.",
|
44 | "$comment": "If `isReadonly` is `true` and `value` is defined then changes to `value`\nshould not be allowed.\n",
|
45 | "type": "boolean",
|
46 | "default": false,
|
47 | "from": "Variable"
|
48 | },
|
49 | "validator": {
|
50 | "@id": "stencila:validator",
|
51 | "description": "The validator that the value is validated against.",
|
52 | "anyOf": [
|
53 | {
|
54 | "$ref": "ValidatorTypes.schema.json"
|
55 | }
|
56 | ],
|
57 | "from": "Variable"
|
58 | },
|
59 | "value": {
|
60 | "@id": "schema:value",
|
61 | "description": "The value of the variable.",
|
62 | "allOf": [
|
63 | {
|
64 | "$ref": "Node.schema.json"
|
65 | }
|
66 | ],
|
67 | "from": "Variable"
|
68 | }
|
69 | },
|
70 | "required": [
|
71 | "type",
|
72 | "name"
|
73 | ],
|
74 | "file": "Variable.schema.yaml",
|
75 | "children": [
|
76 | "Parameter"
|
77 | ],
|
78 | "descendants": [
|
79 | "Parameter"
|
80 | ],
|
81 | "$schema": "http://json-schema.org/draft-07/schema#",
|
82 | "$id": "https://schema.stenci.la/v0/Variable.schema.json",
|
83 | "source": "https://github.com/stencila/schema/blob/master/Variable.schema.yaml",
|
84 | "type": "object",
|
85 | "additionalProperties": false,
|
86 | "propertyAliases": {}
|
87 | }
|