-
Notifications
You must be signed in to change notification settings - Fork 1
/
onem2m.m.weight.json
69 lines (69 loc) · 2.05 KB
/
onem2m.m.weight.json
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
{
"id": "http://openinterconnect.org/onem2mmapping/schemas/onem2m.m.weight.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"description" : "Copyright (c) 2018 Open Connectivity Foundation, Inc. All rights reserved.",
"title": "Weight",
"definitions": {
"onem2m.m.weight": {
"type": "object",
"properties": {
"weight": {
"type": "number",
"description": "Measurement of weight",
"x-ocf-conversion": {
"x-ocf-alias": "oic.r.weight",
"x-to-ocf": [
"oic.r.weight.weight = weight",
"oic.r.weight.units = kg"
],
"x-from-ocf": {
"oneOf": [
{
"properties": {
"oic.r.weight.units": "string",
"enum": ["kg"]
},
"x-from-ocf": [
"weight = oic.r.weight.weight"
]
},
{
"properties": {
"oic.r.weight.units": "string",
"enum": ["g"]
},
"x-from-ocf": [
"weight = oic.r.weight.weight/1000"
]
},
{
"properties": {
"oic.r.weight.units": "string",
"enum": ["lb"]
},
"x-from-ocf": [
"weight = oic.r.weight.weight*0.45"
]
},
{
"properties": {
"oic.r.weight.units": "string",
"enum": ["oz"]
},
"x-from-ocf": [
"weight = oic.r.weight.weight*0.028"
]
}
]
}
}
}
}
}
},
"type": "object",
"allOf": [
{"$ref": "#/definitions/onem2m.m.weight"}
],
"required": [ "weight" ]
}