UNPKG

2.75 kBJSONView Raw
1{
2 "title": "CodeExpression",
3 "@id": "stencila:CodeExpression",
4 "extends": "CodeFragment",
5 "role": "secondary",
6 "status": "stable",
7 "category": "code",
8 "description": "An expression defined in programming language source code.",
9 "properties": {
10 "type": {
11 "@id": "schema:type",
12 "description": "The name of the type.",
13 "type": "string",
14 "enum": [
15 "CodeExpression"
16 ],
17 "default": "CodeExpression",
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 "programmingLanguage": {
33 "@id": "schema:programmingLanguage",
34 "description": "The programming language of the code.",
35 "type": "string",
36 "from": "Code"
37 },
38 "format": {
39 "@id": "schema:encodingFormat",
40 "aliases": [
41 "encoding",
42 "encodingFormat"
43 ],
44 "description": "Media type, typically expressed using a MIME format, of the code.",
45 "$comment": "This property allows the differentiation of formats using the same programming language\nor variants of a programming language. An example is using `programmingLanguage` \"json\" and\n`encodingFormat` \"application/ld+json\" for JSON-LD code examples.\n",
46 "type": "string",
47 "from": "Code"
48 },
49 "text": {
50 "@id": "schema:text",
51 "description": "The text of the code.",
52 "type": "string",
53 "from": "Code"
54 },
55 "output": {
56 "@id": "stencila:output",
57 "description": "The value of the expression when it was last evaluated.",
58 "allOf": [
59 {
60 "$ref": "Node.schema.json"
61 }
62 ],
63 "from": "CodeExpression"
64 },
65 "errors": {
66 "@id": "stencila:errors",
67 "description": "Errors when compiling or executing the chunk.",
68 "type": "array",
69 "items": {
70 "$ref": "CodeError.schema.json"
71 },
72 "from": "CodeExpression",
73 "isArray": true,
74 "isPlural": true,
75 "aliases": [
76 "error"
77 ]
78 }
79 },
80 "file": "CodeExpression.schema.yaml",
81 "children": [],
82 "descendants": [],
83 "$schema": "http://json-schema.org/draft-07/schema#",
84 "$id": "https://schema.stenci.la/v0/CodeExpression.schema.json",
85 "source": "https://github.com/stencila/schema/blob/master/CodeExpression.schema.yaml",
86 "type": "object",
87 "propertyAliases": {
88 "encoding": "format",
89 "encodingFormat": "format",
90 "error": "errors"
91 },
92 "additionalProperties": false,
93 "required": [
94 "type",
95 "text"
96 ]
97}