Skip to content

Commit 0a85e41

Browse files
authored
Merge pull request #265 from bendichter/add/jsonschema
add json schema for probe json file
2 parents 44cca89 + 39f52a8 commit 0a85e41

File tree

1 file changed

+120
-0
lines changed

1 file changed

+120
-0
lines changed

resources/probe.json.schema

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"properties": {
5+
"specification": {
6+
"type": "string",
7+
"value": "probeinterface"
8+
},
9+
"version": {
10+
"type": "string",
11+
"pattern": "^\\d+\\.\\d+\\.\\d+$"
12+
},
13+
"probes": {
14+
"type": "array",
15+
"items": {
16+
"type": "object",
17+
"properties": {
18+
"ndim": {
19+
"type": "integer",
20+
"enum": [2, 3]
21+
},
22+
"si_units": {
23+
"type": "string",
24+
"enum": ["mm","um"]
25+
},
26+
"annotations": {
27+
"type": "object",
28+
"properties": {
29+
"name": { "type": "string" },
30+
"manufacturer": { "type": "string" }
31+
},
32+
"required": ["name", "manufacturer"],
33+
"additionalProperties": true
34+
},
35+
"contact_annotations": {
36+
"type": "object",
37+
"additionalProperties": true
38+
},
39+
"contact_positions": {
40+
"type": "array",
41+
"items": {
42+
"type": "array",
43+
"items": {
44+
"type": "number"
45+
},
46+
"minItems": 2,
47+
"maxItems": 3
48+
}
49+
},
50+
"contact_plane_axes": {
51+
"type": "array",
52+
"items": {
53+
"type": "array",
54+
"items": {
55+
"type": "array",
56+
"items": { "type": "number" },
57+
"minItems": 2,
58+
"maxItems": 3
59+
},
60+
"minItems": 2,
61+
"maxItems": 2
62+
}
63+
},
64+
"contact_shapes": {
65+
"type": "array",
66+
"items": { "type": "string", "enum": ["circle", "rect", "square"] }
67+
},
68+
"contact_shape_params": {
69+
"type": "array",
70+
"items": {
71+
"anyOf": [
72+
{
73+
"type": "object",
74+
"properties": { "radius": { "type": "integer", "minimum": 0 } },
75+
"required": ["radius"]
76+
},
77+
{
78+
"type": "object",
79+
"properties": {
80+
"width": { "type": "integer", "minimum": 0 },
81+
"height": { "type": "integer", "minimum": 0 }
82+
},
83+
"required": ["width"]
84+
}
85+
]
86+
}
87+
},
88+
"probe_planar_contour": {
89+
"type": "array",
90+
"items": {
91+
"type": "array",
92+
"items": { "type": ["integer", "number"] },
93+
"minItems": 2,
94+
"maxItems": 3
95+
}
96+
},
97+
"contact_ids": {
98+
"type": "array",
99+
"items": { "type": "string" }
100+
},
101+
"shank_ids": {
102+
"type": "array",
103+
"items": { "type": "string" }
104+
}
105+
},
106+
"required": [
107+
"ndim",
108+
"si_units",
109+
"annotations",
110+
"contact_positions",
111+
"contact_shapes",
112+
"contact_shape_params"
113+
],
114+
"additionalProperties": false
115+
}
116+
}
117+
},
118+
"required": ["specification", "version", "probes"],
119+
"additionalProperties": false
120+
}

0 commit comments

Comments
 (0)