rsmp_schemer 0.3.1 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +10 -9
- data/lib/rsmp_schemer/version.rb +1 -1
- data/rsmp_schemer.gemspec +1 -1
- data/schemas/core_3.1.2/schema/core/alarm.json +8 -4
- data/schemas/core_3.1.2/spec/core/alarm_spec.rb +15 -0
- data/schemas/core_3.1.4/.gitignore +1 -0
- data/schemas/core_3.1.4/schema/core/alarm.json +8 -4
- data/schemas/core_3.1.4/spec/core/alarm_spec.rb +15 -0
- data/schemas/core_3.1.4/spec/core/version_spec.rb +3 -2
- data/schemas/core_3.1.5/.gitignore +1 -0
- data/schemas/core_3.1.5/schema/core/alarm.json +40 -41
- data/schemas/core_3.1.5/schema/core/alarm_issue.json +44 -0
- data/schemas/core_3.1.5/schema/core/alarm_suspend_resume.json +3 -0
- data/schemas/core_3.1.5/schema/core/alarm_suspended_resumed.json +47 -0
- data/schemas/core_3.1.5/schema/core/command_response.json +1 -1
- data/schemas/core_3.1.5/schema/core/status_response.json +1 -1
- data/schemas/core_3.1.5/schema/core/status_update.json +1 -1
- data/schemas/core_3.1.5/spec/core/alarm_issue_spec.rb +299 -0
- data/schemas/core_3.1.5/spec/core/alarm_resume_spec.rb +93 -0
- data/schemas/core_3.1.5/spec/core/alarm_resumed_spec.rb +277 -0
- data/schemas/core_3.1.5/spec/core/alarm_suspend_spec.rb +93 -0
- data/schemas/core_3.1.5/spec/core/alarm_suspended_spec.rb +277 -0
- data/schemas/core_3.1.5/spec/core/version_spec.rb +3 -2
- data/schemas/tlc_1.0.13/schema/tlc/statuses/S0023.json +1 -1
- data/schemas/tlc_1.0.13/spec/tlc/S0023_spec.rb +96 -0
- data/schemas/tlc_1.0.14/schema/tlc/statuses/S0023.json +1 -1
- data/schemas/tlc_1.0.14/spec/tlc/S0023_spec.rb +96 -0
- data/schemas/tlc_1.0.15/schema/tlc/statuses/S0023.json +1 -1
- data/schemas/tlc_1.0.15/spec/tlc/S0023_spec.rb +96 -0
- metadata +18 -11
- data/schemas/core_3.1.2/examples/validate.rb +0 -35
- data/schemas/core_3.1.4/examples/validate.rb +0 -35
- data/schemas/core_3.1.4/spec/core/alarm_request_spec.rb +0 -72
- data/schemas/core_3.1.5/examples/validate.rb +0 -35
- data/schemas/core_3.1.5/spec/core/alarm_request_spec.rb +0 -72
- data/schemas/core_3.1.5/spec/core/alarm_spec.rb +0 -298
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82a864ad0c18ba82e9aed1074af548dac54e6a0e396cb2d7b567cf0bec629c24
|
4
|
+
data.tar.gz: 7fb5c1565865a0833e8a555131e46e604d93a20e5c118218abb95b6c8730541c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b36b9110c2c9cad63986e2bb8979f875cff92675abc989b77bb021ae159bb271f9d818258f1d3187c8461e90392cde2cb2221a4f9566d221c39ce20bf809f7a0
|
7
|
+
data.tar.gz: 9c0f371915fac4a32f8fa2cc4795aab5ce86864283facc15426911fd3e23d90c6e6cc974b76f853d8b4d671e834d97a0981e83d4ebda1a724c6d3ec3753f0909
|
data/Gemfile.lock
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rsmp_schemer (0.
|
5
|
-
json_schemer (~> 0.2.
|
4
|
+
rsmp_schemer (0.4.1)
|
5
|
+
json_schemer (~> 0.2.21)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
diff-lcs (1.
|
11
|
-
ecma-re-validator (0.
|
12
|
-
regexp_parser (~> 2.
|
10
|
+
diff-lcs (1.5.0)
|
11
|
+
ecma-re-validator (0.4.0)
|
12
|
+
regexp_parser (~> 2.2)
|
13
13
|
hana (1.3.7)
|
14
|
-
json_schemer (0.2.
|
14
|
+
json_schemer (0.2.21)
|
15
15
|
ecma-re-validator (~> 0.3)
|
16
16
|
hana (~> 1.3)
|
17
17
|
regexp_parser (~> 2.0)
|
18
18
|
uri_template (~> 0.7)
|
19
|
-
rake (13.0.
|
20
|
-
regexp_parser (2.
|
19
|
+
rake (13.0.6)
|
20
|
+
regexp_parser (2.5.0)
|
21
21
|
rspec (3.9.0)
|
22
22
|
rspec-core (~> 3.9.0)
|
23
23
|
rspec-expectations (~> 3.9.0)
|
@@ -35,6 +35,7 @@ GEM
|
|
35
35
|
|
36
36
|
PLATFORMS
|
37
37
|
x86_64-darwin-20
|
38
|
+
x86_64-darwin-21
|
38
39
|
|
39
40
|
DEPENDENCIES
|
40
41
|
rake (~> 13.0)
|
@@ -43,4 +44,4 @@ DEPENDENCIES
|
|
43
44
|
rspec-expectations (~> 3.9.1)
|
44
45
|
|
45
46
|
BUNDLED WITH
|
46
|
-
2.
|
47
|
+
2.3.5
|
data/lib/rsmp_schemer/version.rb
CHANGED
data/rsmp_schemer.gemspec
CHANGED
@@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
40
40
|
spec.require_paths = ["lib"]
|
41
41
|
|
42
|
-
spec.add_dependency "json_schemer", "~> 0.2.
|
42
|
+
spec.add_dependency "json_schemer", "~> 0.2.21"
|
43
43
|
|
44
44
|
spec.add_development_dependency "rspec", "~> 3.9.0"
|
45
45
|
spec.add_development_dependency "rspec-expectations", "~> 3.9.1"
|
@@ -9,22 +9,26 @@
|
|
9
9
|
"aSp" : {
|
10
10
|
"description" : "Alarm message variant",
|
11
11
|
"type" : "string",
|
12
|
-
"enum" : [ "Issue", "Acknowledge", "Suspend", "Resume"
|
12
|
+
"enum" : [ "Issue", "Acknowledge", "Suspend", "Resume",
|
13
|
+
"issue", "acknowledge", "suspend", "resume" ]
|
13
14
|
},
|
14
15
|
"ack" : {
|
15
16
|
"description" : "Acknowledgement",
|
16
17
|
"type" : "string",
|
17
|
-
"enum" : [ "Acknowledged", "notAcknowledged"
|
18
|
+
"enum" : [ "Acknowledged", "notAcknowledged",
|
19
|
+
"acknowledged", "NotAcknowledged" ]
|
18
20
|
},
|
19
21
|
"aS" : {
|
20
22
|
"description" : "Status",
|
21
23
|
"type" : "string",
|
22
|
-
"enum" : [ "inActive", "Active"
|
24
|
+
"enum" : [ "inActive", "Active",
|
25
|
+
"InActive", "active" ]
|
23
26
|
},
|
24
27
|
"sS" : {
|
25
28
|
"description" : "Suspended",
|
26
29
|
"type" : "string",
|
27
|
-
"enum" : [ "suspended", "notSuspended"
|
30
|
+
"enum" : [ "suspended", "notSuspended",
|
31
|
+
"Suspended", "NotSuspended" ]
|
28
32
|
},
|
29
33
|
"aTs" : { "$ref": "definitions.json#/timestamp" },
|
30
34
|
"cat" : {
|
@@ -89,6 +89,21 @@ RSpec.describe "Traffic Light Controller RSMP SXL Schema validation" do
|
|
89
89
|
])
|
90
90
|
end
|
91
91
|
|
92
|
+
it 'accept states with first letter in lowercase' do
|
93
|
+
invalid = message.dup
|
94
|
+
invalid['aSp'] = "issue"
|
95
|
+
expect( validate(invalid) ).to be_nil
|
96
|
+
|
97
|
+
invalid['aSp'] = "acknowledge"
|
98
|
+
expect( validate(invalid) ).to be_nil
|
99
|
+
|
100
|
+
invalid['aSp'] = "suspend"
|
101
|
+
expect( validate(invalid) ).to be_nil
|
102
|
+
|
103
|
+
invalid['aSp'] = "resume"
|
104
|
+
expect( validate(invalid) ).to be_nil
|
105
|
+
end
|
106
|
+
|
92
107
|
it 'catches wrong state type' do
|
93
108
|
invalid = message.dup
|
94
109
|
invalid['aSp'] = 123
|
@@ -0,0 +1 @@
|
|
1
|
+
.DS_Store
|
@@ -9,22 +9,26 @@
|
|
9
9
|
"aSp" : {
|
10
10
|
"description" : "Alarm message variant",
|
11
11
|
"type" : "string",
|
12
|
-
"enum" : [ "Issue", "Acknowledge", "Suspend", "Resume"
|
12
|
+
"enum" : [ "Issue", "Acknowledge", "Suspend", "Resume",
|
13
|
+
"issue", "acknowledge", "suspend", "resume" ]
|
13
14
|
},
|
14
15
|
"ack" : {
|
15
16
|
"description" : "Acknowledgement",
|
16
17
|
"type" : "string",
|
17
|
-
"enum" : [ "Acknowledged", "notAcknowledged"
|
18
|
+
"enum" : [ "Acknowledged", "notAcknowledged",
|
19
|
+
"acknowledged", "NotAcknowledged" ]
|
18
20
|
},
|
19
21
|
"aS" : {
|
20
22
|
"description" : "Status",
|
21
23
|
"type" : "string",
|
22
|
-
"enum" : [ "inActive", "Active"
|
24
|
+
"enum" : [ "inActive", "Active",
|
25
|
+
"InActive", "active" ]
|
23
26
|
},
|
24
27
|
"sS" : {
|
25
28
|
"description" : "Suspended",
|
26
29
|
"type" : "string",
|
27
|
-
"enum" : [ "suspended", "notSuspended"
|
30
|
+
"enum" : [ "suspended", "notSuspended",
|
31
|
+
"Suspended", "NotSuspended" ]
|
28
32
|
},
|
29
33
|
"aTs" : { "$ref": "definitions.json#/timestamp" },
|
30
34
|
"cat" : {
|
@@ -89,6 +89,21 @@ RSpec.describe "Traffic Light Controller RSMP SXL Schema validation" do
|
|
89
89
|
])
|
90
90
|
end
|
91
91
|
|
92
|
+
it 'accept states with first letter in lowercase' do
|
93
|
+
invalid = message.dup
|
94
|
+
invalid['aSp'] = "issue"
|
95
|
+
expect( validate(invalid) ).to be_nil
|
96
|
+
|
97
|
+
invalid['aSp'] = "acknowledge"
|
98
|
+
expect( validate(invalid) ).to be_nil
|
99
|
+
|
100
|
+
invalid['aSp'] = "suspend"
|
101
|
+
expect( validate(invalid) ).to be_nil
|
102
|
+
|
103
|
+
invalid['aSp'] = "resume"
|
104
|
+
expect( validate(invalid) ).to be_nil
|
105
|
+
end
|
106
|
+
|
92
107
|
it 'catches wrong state type' do
|
93
108
|
invalid = message.dup
|
94
109
|
invalid['aSp'] = 123
|
@@ -10,9 +10,10 @@ RSpec.describe "Traffic Light Controller RSMP SXL Schema validation" do
|
|
10
10
|
{ "vers" => "3.1.1" },
|
11
11
|
{ "vers" => "3.1.2" },
|
12
12
|
{ "vers" => "3.1.3" },
|
13
|
-
{ "vers" => "3.1.4" }
|
13
|
+
{ "vers" => "3.1.4" },
|
14
|
+
{ "vers" => "3.1.5" }
|
14
15
|
],
|
15
|
-
"SXL" => "1.
|
16
|
+
"SXL" => "1.0.15"
|
16
17
|
}}
|
17
18
|
|
18
19
|
it 'accepts valid message' do
|
@@ -0,0 +1 @@
|
|
1
|
+
.DS_Store
|
@@ -7,49 +7,48 @@
|
|
7
7
|
"aCId" : { "$ref": "definitions.json#/alarm_code" },
|
8
8
|
"xACId" : { "description" : "External alarm code id", "type" : "string" },
|
9
9
|
"aSp" : {
|
10
|
-
"description" : "Alarm
|
10
|
+
"description" : "Alarm specialization",
|
11
11
|
"type" : "string",
|
12
|
-
"enum" : [ "Issue", "Acknowledge", "Suspend", "Resume", "Request"
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
"sS" : {
|
25
|
-
"description" : "Suspended",
|
26
|
-
"type" : "string",
|
27
|
-
"enum" : [ "suspended", "notSuspended" ]
|
28
|
-
},
|
29
|
-
"aTs" : { "$ref": "definitions.json#/timestamp" },
|
30
|
-
"cat" : {
|
31
|
-
"description" : "Category",
|
32
|
-
"type" : "string",
|
33
|
-
"enum" : [ "T", "D" ]
|
12
|
+
"enum" : [ "Issue", "Acknowledge", "Suspend", "Resume", "Request",
|
13
|
+
"issue", "acknowledge", "suspend", "resume", "request" ]
|
14
|
+
}
|
15
|
+
},
|
16
|
+
"required" : [ "aSp"],
|
17
|
+
"allOf" : [
|
18
|
+
{
|
19
|
+
"if": {
|
20
|
+
"required" : [ "aSp" ],
|
21
|
+
"properties" : { "aSp" : { "const" : "Issue" } }
|
22
|
+
},
|
23
|
+
"then": { "$ref": "alarm_issue.json" }
|
34
24
|
},
|
35
|
-
|
36
|
-
"
|
37
|
-
|
38
|
-
|
25
|
+
{
|
26
|
+
"if": {
|
27
|
+
"allOf" : [
|
28
|
+
{
|
29
|
+
"required" : [ "aSp" ],
|
30
|
+
"properties" : {
|
31
|
+
"aSp" : { "enum" : [ "Suspend","Resume",
|
32
|
+
"suspend", "resume"] }
|
33
|
+
}
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"not": { "required" : [ "sS" ] }
|
37
|
+
}
|
38
|
+
]
|
39
|
+
},
|
40
|
+
"then": { "$ref": "alarm_suspend_resume.json" }
|
39
41
|
},
|
40
|
-
|
41
|
-
"
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
"additionProperties": false
|
51
|
-
}
|
42
|
+
{
|
43
|
+
"if": {
|
44
|
+
"required" : [ "aSp", "sS" ],
|
45
|
+
"properties" : {
|
46
|
+
"aSp" : { "const" : "Suspend" },
|
47
|
+
"sS" : { "enum" : [ "suspended", "notSuspended",
|
48
|
+
"Suspended", "NotSuspended" ] }
|
49
|
+
}
|
50
|
+
},
|
51
|
+
"then": { "$ref": "alarm_suspended_resumed.json" }
|
52
52
|
}
|
53
|
-
|
54
|
-
"required" : [ "mId", "cId", "aCId", "xACId", "aSp", "ack", "aS", "aTs", "sS", "cat", "pri", "rvs" ]
|
53
|
+
]
|
55
54
|
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
{
|
2
|
+
"properties" : {
|
3
|
+
"ack" : {
|
4
|
+
"description" : "Acknowledgement",
|
5
|
+
"type" : "string",
|
6
|
+
"enum" : [ "Acknowledged", "notAcknowledged" ]
|
7
|
+
},
|
8
|
+
"aS" : {
|
9
|
+
"description" : "Active status",
|
10
|
+
"type" : "string",
|
11
|
+
"enum" : [ "inActive", "Active" ]
|
12
|
+
},
|
13
|
+
"sS" : {
|
14
|
+
"description" : "Suspend status",
|
15
|
+
"type" : "string",
|
16
|
+
"enum" : [ "suspended", "notSuspended" ]
|
17
|
+
},
|
18
|
+
"aTs" : { "$ref": "definitions.json#/timestamp" },
|
19
|
+
"cat" : {
|
20
|
+
"description" : "Category",
|
21
|
+
"type" : "string",
|
22
|
+
"enum" : [ "T", "D" ]
|
23
|
+
},
|
24
|
+
"pri" : {
|
25
|
+
"description" : "Priority",
|
26
|
+
"type" : "string",
|
27
|
+
"enum" : [ "1", "2", "3" ]
|
28
|
+
},
|
29
|
+
"rvs" : {
|
30
|
+
"description" : "Return values",
|
31
|
+
"type" : "array",
|
32
|
+
"items" : {
|
33
|
+
"type" : "object",
|
34
|
+
"properties": {
|
35
|
+
"n" : { "description" : "Unique reference of the value", "type" : "string" },
|
36
|
+
"v" : { "description" : "Value", "type" : "string" }
|
37
|
+
},
|
38
|
+
"required" : [ "n", "v" ],
|
39
|
+
"additionalProperties": false
|
40
|
+
}
|
41
|
+
}
|
42
|
+
},
|
43
|
+
"required" : [ "mId", "cId", "aCId", "xACId", "aSp", "ack", "aS", "aTs", "sS", "cat", "pri", "rvs" ]
|
44
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
{
|
2
|
+
"properties" : {
|
3
|
+
"ack" : {
|
4
|
+
"description" : "Acknowledgement",
|
5
|
+
"type" : "string",
|
6
|
+
"enum" : [ "Acknowledged", "notAcknowledged",
|
7
|
+
"acknowledged", "NotAcknowledged" ]
|
8
|
+
},
|
9
|
+
"aS" : {
|
10
|
+
"description" : "Active status",
|
11
|
+
"type" : "string",
|
12
|
+
"enum" : [ "inActive", "Active",
|
13
|
+
"InActive", "active" ]
|
14
|
+
},
|
15
|
+
"sS" : {
|
16
|
+
"description" : "Suspend status",
|
17
|
+
"type" : "string",
|
18
|
+
"enum" : [ "suspended", "notSuspended",
|
19
|
+
"Suspended", "NotSuspended" ]
|
20
|
+
},
|
21
|
+
"aTs" : { "$ref": "definitions.json#/timestamp" },
|
22
|
+
"cat" : {
|
23
|
+
"description" : "Category",
|
24
|
+
"type" : "string",
|
25
|
+
"enum" : [ "T", "D" ]
|
26
|
+
},
|
27
|
+
"pri" : {
|
28
|
+
"description" : "Priority",
|
29
|
+
"type" : "string",
|
30
|
+
"enum" : [ "1", "2", "3" ]
|
31
|
+
},
|
32
|
+
"rvs" : {
|
33
|
+
"description" : "Return values",
|
34
|
+
"type" : "array",
|
35
|
+
"items" : {
|
36
|
+
"type" : "object",
|
37
|
+
"properties": {
|
38
|
+
"n" : { "description" : "Unique reference of the value", "type" : "string" },
|
39
|
+
"v" : { "description" : "Value", "type" : "string" }
|
40
|
+
},
|
41
|
+
"required" : [ "n", "v" ],
|
42
|
+
"additionalProperties": false
|
43
|
+
}
|
44
|
+
}
|
45
|
+
},
|
46
|
+
"required" : [ "mId", "cId", "aCId", "xACId", "aSp", "ack", "aS", "aTs", "sS", "cat", "pri", "rvs" ]
|
47
|
+
}
|