-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema-WaterContent.ts
56 lines (47 loc) · 1.23 KB
/
schema-WaterContent.ts
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
import type { JSONSchema8 } from 'jsonschema8'
export const schema: JSONSchema8 = {
type: 'object',
properties: {
_id: { type: 'string' },
_rev: { type: 'number' },
_type: { const: 'application/vnd.iot4ag.soils.water-content.1+json' },
data: {
type: 'object',
additionalProperties: {
type: 'object',
properties: {
deviceid: { type: 'string' },
depth: {
type: 'object',
properties: {
units: { enum: ['cm','in'] },
value: { type: 'number' },
}, required: [ 'units', 'value' ],
},
time: { type: 'string' },
vwc: {
type: 'object',
properties: {
units: { enum: [ '%' ] },
value: { type: 'number' },
}, required: [ 'units', 'value' ],
},
},
required: [ 'deviceid', 'depth', 'time', 'vwc' ],
}
}
},
required: [ 'data' ],
examples: [
{
data: {
'0kjf20ijfklsdfj': {
time: '2023-07-26 23:59:33.504+00',
deviceid: '0d2ijfkldjflkds',
depth: { value: 2, units: 'cm' },
vwc: { value: 18.4, units: '%' },
}
}
},
],
};