UNPKG

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