Repository navigation
Expand file tree
/
Copy pathapi-json-compact.schema.json
More file actions
58 lines (58 loc) · 2.37 KB
/
Copy pathapi-json-compact.schema.json
File metadata and controls
58 lines (58 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/Open-MBEE/OpenSysML/docs/reference/api-json-compact.schema.json",
"title": "api-json-compact/1",
"description": "The compact form of the SysML v2 API JSON element array that Convert writes under the convert_compact capability. See api-json-compact.md for the rules that expand it to the element array.",
"type": "object",
"required": ["format", "ids", "elementCount", "referenceKeys", "elements"],
"additionalProperties": false,
"properties": {
"format": { "const": "api-json-compact/1" },
"ids": {
"description": "The id table. A handle is an index into it.",
"type": "array",
"items": { "type": "string" }
},
"elementCount": {
"description": "ids[0 .. elementCount) are the written elements, in order. It never exceeds the table's length.",
"type": "integer",
"minimum": 0
},
"elementIdsAreIds": {
"description": "Present only when every element's elementId is its @id, in which case no element writes it.",
"const": true
},
"referenceKeys": {
"description": "Keys whose references are bare handles. None of them carries a number.",
"type": "array",
"items": { "type": "string" },
"uniqueItems": true
},
"elements": {
"type": "array",
"items": { "$ref": "#/$defs/element" }
}
},
"$defs": {
"handle": { "type": "integer", "minimum": 0 },
"element": {
"description": "An element: its @type, then its properties. It carries no @id; element i has the id ids[i].",
"type": "object",
"required": ["@type"],
"properties": {
"@type": { "type": "string" },
"@id": false
},
"additionalProperties": { "$ref": "#/$defs/value" }
},
"value": {
"description": "A property value: a scalar, a bare handle under a reference key, an {\"@id\": handle} or {\"@ref\": name} object, or an array of them.",
"oneOf": [
{ "type": ["string", "number", "boolean", "null"] },
{ "type": "object", "required": ["@id"], "properties": { "@id": { "$ref": "#/$defs/handle" } }, "additionalProperties": false },
{ "type": "object", "required": ["@ref"], "properties": { "@ref": { "type": "string" } }, "additionalProperties": false },
{ "type": "array", "items": { "$ref": "#/$defs/value" } }
]
}
}
}