-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraph.schema.json
More file actions
91 lines (91 loc) · 2.89 KB
/
Copy pathgraph.schema.json
File metadata and controls
91 lines (91 loc) · 2.89 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/ros2-node-map/ros2-node-map/blob/main/docs/graph.schema.json",
"title": "ros2-node-map graph snapshot",
"type": "object",
"additionalProperties": false,
"required": ["schema_version", "timestamp", "ros_domain_id", "nodes", "edges"],
"properties": {
"schema_version": { "const": "0.2.0" },
"timestamp": { "type": "string", "format": "date-time" },
"ros_domain_id": { "type": "string", "pattern": "^[0-9]+$" },
"nodes": {
"type": "array",
"items": { "$ref": "#/$defs/node" }
},
"edges": {
"type": "array",
"items": { "$ref": "#/$defs/edge" }
}
},
"$defs": {
"nodeBase": {
"type": "object",
"required": ["id", "kind", "label"],
"properties": {
"id": { "type": "string", "minLength": 1 },
"kind": {
"enum": ["ros_node", "ros_topic", "ros_service", "ros_action"]
},
"label": { "type": "string", "pattern": "^/" }
}
},
"node": {
"oneOf": [
{
"allOf": [
{ "$ref": "#/$defs/nodeBase" },
{
"type": "object",
"additionalProperties": false,
"required": ["id", "kind", "label", "name", "namespace"],
"properties": {
"id": { "type": "string", "pattern": "^node:/.+#[1-9][0-9]*$" },
"kind": { "const": "ros_node" },
"label": { "type": "string", "pattern": "^/" },
"name": { "type": "string", "minLength": 1 },
"namespace": { "type": "string", "pattern": "^/" }
}
}
]
},
{
"allOf": [
{ "$ref": "#/$defs/nodeBase" },
{
"type": "object",
"additionalProperties": false,
"required": ["id", "kind", "label"],
"properties": {
"id": { "type": "string", "pattern": "^(topic|service|action):/" },
"kind": { "enum": ["ros_topic", "ros_service", "ros_action"] },
"label": { "type": "string", "pattern": "^/" },
"types": {
"type": "array",
"items": { "type": "string", "minLength": 1 },
"uniqueItems": true
}
}
}
]
}
]
},
"edge": {
"type": "object",
"additionalProperties": false,
"required": ["id", "kind", "source", "target"],
"properties": {
"id": { "type": "string", "minLength": 1 },
"kind": {
"enum": [
"publish", "subscribe", "service_client", "service_server",
"action_client", "action_server"
]
},
"source": { "type": "string", "minLength": 1 },
"target": { "type": "string", "minLength": 1 }
}
}
}
}