rsmp_schema 0.2.2 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rsmp_schema/convert/export/json_schema.rb +10 -4
- data/lib/rsmp_schema/version.rb +1 -1
- data/schemas/core/3.2/rsmp.json +2 -2
- data/schemas/core/3.2/status_response.json +30 -0
- data/schemas/core/3.2/status_update.json +30 -0
- data/schemas/tlc/1.1/statuses/S0091.json +3 -4
- data/schemas/tlc/1.1/statuses/S0092.json +3 -4
- data/schemas/tlc/1.1/sxl.yaml +2 -4
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da6aa7917da1551ed490189b8b6d782c9ae6c6d4baf4b46adabcc21cc801cc19
|
4
|
+
data.tar.gz: a916a1d6fbc64fcdc050f1be7a4d6c2a603497c54e73baa58c7d775c8c39c803
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 675151863b4bbbffa9d6598e833dcda25d48cf0ce332c9ce05e035fe7f6567269e1b180032182335eeeaf2ae915fc78a75478116f21fcfa496809cffdbeeaf49
|
7
|
+
data.tar.gz: baf90db70f6950c2a7c20bec201d4b347fd478e5716f71fdef263db690edf8423df45ad0531fef3a26b8ade57eec0eacfb3ac1004dde88420f197a9740345285
|
data/Gemfile.lock
CHANGED
@@ -108,13 +108,19 @@ module RSMP
|
|
108
108
|
# convert yaml values to jsons schema enum
|
109
109
|
def self.handle_enum item, out
|
110
110
|
if item["values"]
|
111
|
-
case item["values"]
|
111
|
+
out["enum"] = case item["values"]
|
112
112
|
when Hash
|
113
|
-
|
113
|
+
item["values"].keys.sort
|
114
114
|
when Array
|
115
|
-
|
115
|
+
item["values"].sort
|
116
116
|
else
|
117
|
-
raise "Error: Values must be specified as either a Hash or an Array"
|
117
|
+
raise "Error: Values must be specified as either a Hash or an Array, got #{item["values"].class}"
|
118
|
+
end.map do |v|
|
119
|
+
if v.is_a?(Integer) || v.is_a?(Float)
|
120
|
+
v.to_s
|
121
|
+
else
|
122
|
+
v
|
123
|
+
end
|
118
124
|
end
|
119
125
|
end
|
120
126
|
end
|
data/lib/rsmp_schema/version.rb
CHANGED
data/schemas/core/3.2/rsmp.json
CHANGED
@@ -99,7 +99,7 @@
|
|
99
99
|
"properties": { "type": { "const": "StatusResponse" } }
|
100
100
|
},
|
101
101
|
"then": {
|
102
|
-
"$ref": "../3.
|
102
|
+
"$ref": "../3.2/status_response.json"
|
103
103
|
}
|
104
104
|
},
|
105
105
|
{
|
@@ -126,7 +126,7 @@
|
|
126
126
|
"properties": { "type": { "const": "StatusUpdate" } }
|
127
127
|
},
|
128
128
|
"then": {
|
129
|
-
"$ref": "../3.
|
129
|
+
"$ref": "../3.2/status_update.json"
|
130
130
|
}
|
131
131
|
}
|
132
132
|
]
|
@@ -0,0 +1,30 @@
|
|
1
|
+
{
|
2
|
+
"title" : "StatusResponse",
|
3
|
+
"description" : "Status response",
|
4
|
+
"properties" : {
|
5
|
+
"mId" : { "$ref": "../3.1.1/definitions.json#/message_id" },
|
6
|
+
"cId" : { "$ref": "../3.1.1/definitions.json#/component_id" },
|
7
|
+
"sTs" : { "$ref": "../3.1.1/definitions.json#/timestamp" },
|
8
|
+
"sS" : {
|
9
|
+
"description" : "Status response arguments",
|
10
|
+
"type" : "array",
|
11
|
+
"minItems": 1,
|
12
|
+
"items" : {
|
13
|
+
"type" : "object",
|
14
|
+
"properties": {
|
15
|
+
"sCI" : { "$ref": "../3.1.1/definitions.json#/status_code" },
|
16
|
+
"n" : { "description" : "Unique reference of the value", "type" : "string" },
|
17
|
+
"s" : { "description" : "Value", "type" : ["string"," array"] }, // 3.2 allow arrays
|
18
|
+
"q" : {
|
19
|
+
"description" : "Value",
|
20
|
+
"type" : "string",
|
21
|
+
"enum" : [ "recent", "old", "undefined", "unknown" ]
|
22
|
+
}
|
23
|
+
},
|
24
|
+
"required" : [ "sCI", "n", "s", "q" ],
|
25
|
+
"additionalProperties": false
|
26
|
+
}
|
27
|
+
}
|
28
|
+
},
|
29
|
+
"required" : [ "mId", "cId", "sTs", "sS" ]
|
30
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
{
|
2
|
+
"title" : "StatusUpdate",
|
3
|
+
"description" : "Status update",
|
4
|
+
"properties" : {
|
5
|
+
"mId" : { "$ref": "../3.1.1/definitions.json#/message_id" },
|
6
|
+
"cId" : { "$ref": "../3.1.1/definitions.json#/component_id" },
|
7
|
+
"sTs" : { "$ref": "../3.1.1/definitions.json#/timestamp" },
|
8
|
+
"sS" : {
|
9
|
+
"description" : "Status update arguments",
|
10
|
+
"type" : "array",
|
11
|
+
"minItems": 1,
|
12
|
+
"items" : {
|
13
|
+
"type" : "object",
|
14
|
+
"properties": {
|
15
|
+
"sCI" : { "$ref": "../3.1.1/definitions.json#/status_code" },
|
16
|
+
"n" : { "description" : "Unique reference of the value", "type" : "string" },
|
17
|
+
"s" : { "description" : "Value", "type" : ["string","array"] }, // array is allowed from 3.2
|
18
|
+
"q" : {
|
19
|
+
"description" : "Value",
|
20
|
+
"type" : "string",
|
21
|
+
"enum" : [ "recent", "old", "undefined", "unknown" ]
|
22
|
+
}
|
23
|
+
},
|
24
|
+
"required" : [ "sCI", "n", "s", "q" ],
|
25
|
+
"additionalProperties": false
|
26
|
+
}
|
27
|
+
}
|
28
|
+
},
|
29
|
+
"required" : [ "mId", "cId", "sTs", "sS" ]
|
30
|
+
}
|
data/schemas/tlc/1.1/sxl.yaml
CHANGED
@@ -781,8 +781,7 @@ objects:
|
|
781
781
|
arguments:
|
782
782
|
user:
|
783
783
|
type: integer
|
784
|
-
values:
|
785
|
-
description: |-
|
784
|
+
values:
|
786
785
|
0: Nobody logged in
|
787
786
|
1: Operator logged in at level 1 (read only)
|
788
787
|
2: Operator logged in at level 2 (read/write)
|
@@ -793,8 +792,7 @@ objects:
|
|
793
792
|
arguments:
|
794
793
|
user:
|
795
794
|
type: integer
|
796
|
-
values:
|
797
|
-
description: |-
|
795
|
+
values:
|
798
796
|
0: Nobody logged in
|
799
797
|
1: Operator logged in at level 1 (read only)
|
800
798
|
2: Operator logged in at level 2 (read/write)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsmp_schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emil Tin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json_schemer
|
@@ -155,6 +155,8 @@ files:
|
|
155
155
|
- schemas/core/3.2/alarm.json
|
156
156
|
- schemas/core/3.2/core.json
|
157
157
|
- schemas/core/3.2/rsmp.json
|
158
|
+
- schemas/core/3.2/status_response.json
|
159
|
+
- schemas/core/3.2/status_update.json
|
158
160
|
- schemas/tlc/1.0.10/alarms/A0001.json
|
159
161
|
- schemas/tlc/1.0.10/alarms/A0002.json
|
160
162
|
- schemas/tlc/1.0.10/alarms/A0003.json
|