-
Notifications
You must be signed in to change notification settings - Fork 0
Add RSMP Core 3.3.0 JSON Schema Support with Minimal Duplication #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 3 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5fdec21
Initial plan
Copilot 5516075
Initial analysis of RSMP 3.3.0 requirements
Copilot 3a69b2c
Create RSMP 3.3.0 core schema with key changes
Copilot aa8ac15
Refactor 3.3.0 schema to minimize duplication and allow additionalPro…
Copilot bd0794c
Initial plan
Copilot 0051d2e
Initial exploration and analysis of rsmp_schema repository
Copilot 3be41f8
Create comprehensive GitHub Copilot instructions and update gitignore
Copilot 7e9d5d4
Address feedback on copilot-instructions.md: assume Ruby installed, r…
Copilot c84d334
Replace hardcoded Ruby version with dynamic reference to .tool-versions
Copilot da444ab
Replace ruby command with .tool-versions parsing for PATH construction
Copilot 6934986
Add mise as recommended Ruby version manager in copilot instructions
Copilot a86ed6d
Remove unnecessary bundle path configuration from copilot instructions
Copilot e7b662a
Remove manual setup section from copilot instructions as requested
Copilot 42254d8
Update copilot-instructions.md
emiltin af79dae
Initial plan
Copilot 212e073
Implement RSMP 3.3.0 core schema with minimal duplication and working…
Copilot 1ece482
Fix RSMP 3.3.0 tests and component_id references
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,4 @@ | |
| /tmp/ | ||
| /.DS_Store | ||
| /.rspec_status | ||
| /vendor/bundle/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "title" : "CommandRequest", | ||
| "description" : "Command request - only single command (cCI) allowed per request", | ||
| "properties" : { | ||
| "mId" : { "$ref": "definitions.json#/message_id" }, | ||
| "cId" : { "$ref": "definitions.json#/component_id" }, | ||
| "arg" : { | ||
| "description" : "Command arguments", | ||
| "type" : "array", | ||
| "minItems": 1, | ||
| "items" : { | ||
| "type" : "object", | ||
| "properties": { | ||
| "cCI" : { "$ref": "definitions.json#/command_code" }, | ||
| "n" : { "description" : "Unique reference of the value", "type" : "string" }, | ||
| "cO" : { "description" : "Command", "type" : "string" }, | ||
| "v" : { "description" : "Value" } | ||
| }, | ||
| "required" : [ "cCI", "n", "cO", "v" ] | ||
| } | ||
| } | ||
| }, | ||
| "required" : [ "mId", "cId", "arg"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| { | ||
| "title" : "CommandResponse", | ||
| "description" : "Command response - only single command (cCI) allowed per response", | ||
| "properties" : { | ||
| "mId" : { "$ref": "definitions.json#/message_id" }, | ||
| "cId" : { "$ref": "definitions.json#/component_id" }, | ||
| "cTS" : { "$ref": "definitions.json#/timestamp" }, | ||
| "rvs" : { | ||
| "description" : "Command return values", | ||
| "type" : "array", | ||
| "items" : { | ||
| "type" : "object", | ||
| "properties": { | ||
| "cCI" : { "$ref": "definitions.json#/command_code" }, | ||
| "n" : { | ||
| "description" : "Unique reference of the value", | ||
| "type" : "string" | ||
| }, | ||
| "v" : { | ||
| "description" : "Value" | ||
| }, | ||
| "age" : { | ||
| "description" : "Age of the value", | ||
| "type" : "string", | ||
| "enum" : [ "recent", "old", "undefined", "unknown" ] | ||
| } | ||
| }, | ||
| "required" : [ "cCI", "n", "v", "age" ], | ||
| "additionalProperties": false | ||
| } | ||
| } | ||
| }, | ||
| "required" : [ "mId", "cId", "cTS", "rvs" ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| { | ||
| "message_id": { | ||
| "description" : "Message Id", | ||
| "type": "string", | ||
| "$comment" : "Example: 1.2.3 or 1.2", | ||
| "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$" | ||
| }, | ||
| "timestamp" : { | ||
| "description" : "Timestamp", | ||
| "type": "string", | ||
| "$comment" : "Example: 2015-06-08T11:49:03.293Z", | ||
| "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$" | ||
| }, | ||
| "integer" : { | ||
| "description" : "Integer as string", | ||
| "type": "string", | ||
| "$comment" : "Example: 123 or -123", | ||
| "pattern": "^\\-?[0-9]+$" | ||
| }, | ||
| "number_as_string" : { | ||
| "description" : "Number as string", | ||
| "type": "string", | ||
| "$comment" : "Example: 123, -123, 0.5, -2.4", | ||
| "pattern": "^\\-?[0-9]+(\\.[0-9]+)?$" | ||
| }, | ||
| "version": { | ||
| "description" : "Version", | ||
| "type": "string", | ||
| "$comment" : "Example: 1.2.3 or 1.2", | ||
| "pattern" : "^[0-9]{1,2}\\.[0-9]{1,2}(\\.[0-9]{1,2})?" | ||
| }, | ||
| "command_code": { | ||
| "description" : "Command code id", | ||
| "type" : "string", | ||
| "pattern" : "^M" | ||
| }, | ||
| "status_code": { | ||
| "description" : "Status code id", | ||
| "type" : "string", | ||
| "pattern" : "^S" | ||
| }, | ||
| "alarm_code": { | ||
| "description" : "Alarm code id", | ||
| "type" : "string", | ||
| "pattern" : "^A" | ||
| }, | ||
| "component_id": { | ||
| "description" : "Component id - supports both format A (AA+BBCDD=EEEFFGGG) and format B (/component/path)", | ||
| "anyOf": [ | ||
| { | ||
| "$comment": "Format A: Traditional component id like KK+AG0503=001DL001", | ||
| "type": "string", | ||
| "pattern": "^[A-Za-z0-9]+\\+[A-Za-z0-9]+=.+$" | ||
| }, | ||
| { | ||
| "$comment": "Format B: Hierarchical component id like /sg/1 or /dl/radar/1", | ||
| "type": "string", | ||
| "pattern": "^(/[^/]+)+$", | ||
| "not": { | ||
| "pattern": "/$" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what uses cases does this cover, and why is it needed? |
||
| } | ||
| }, | ||
| { | ||
| "$comment": "Empty string refers to main component", | ||
| "type": "string", | ||
| "enum": [""] | ||
| }, | ||
| { | ||
| "$comment": "Null refers to main component", | ||
| "type": "null" | ||
| } | ||
| ] | ||
| }, | ||
| "boolean": { | ||
| "description" : "Boolean as string", | ||
| "type" : "string", | ||
| "enum" : [ "True", "False" ] | ||
| }, | ||
| "integer_list": { | ||
| "description" : "Comma-separated list of integers as strings", | ||
| "type" : "string", | ||
| "pattern" : "^(\\-?\\d+)(?:,(\\-?\\d+))*$" | ||
| }, | ||
| "boolean_list": { | ||
| "description" : "Comma-separated list of booleans as strings", | ||
| "type" : "string", | ||
| "pattern" : "^(True|False)(?:,(True|False))*$" | ||
| }, | ||
| "string_list": { | ||
| "description" : "Comma-separated list of strings", | ||
| "type" : "string" | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| { | ||
| "allOf": [ | ||
| { | ||
| "$ref": "../3.2.0/core.json" | ||
| }, | ||
| { | ||
| "if": { | ||
| "required" : ["type"], | ||
| "properties": { "type": { "const": "MessageAck" } } | ||
| }, | ||
| "then": { | ||
| "$ref": "../3.1.2/message_ack.json" | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "required" : ["type"], | ||
| "properties": { "type": { "const": "MessageNotAck" } } | ||
| }, | ||
| "then": { | ||
| "$ref": "../3.1.2/message_not_ack.json" | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "required" : ["type"], | ||
| "properties": { "type": { "const": "Version" } } | ||
| }, | ||
| "then": { | ||
| "$ref": "version.json" | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "required" : ["type"], | ||
| "properties": { "type": { "const": "AggregatedStatus" } } | ||
| }, | ||
| "then": { | ||
| "$ref": "../3.1.3/aggregated_status.json" | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "required" : ["type"], | ||
| "properties": { "type": { "const": "AggregatedStatusRequest" } } | ||
| }, | ||
| "then": { | ||
| "$ref": "../3.1.5/aggregated_status_request.json" | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "required" : ["type"], | ||
| "properties": { "type": { "const": "Watchdog" } } | ||
| }, | ||
| "then": { | ||
| "$ref": "../3.1.2/watchdog.json" | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "required" : ["type"], | ||
| "properties": { "type": { "const": "Alarm" } } | ||
| }, | ||
| "then": { | ||
| "$ref": "../3.2.0/alarm.json" | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "required" : ["type"], | ||
| "properties": { "type": { "const": "CommandRequest" } } | ||
| }, | ||
| "then": { | ||
| "$ref": "command_request.json" | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "required" : ["type"], | ||
| "properties": { "type": { "const": "CommandResponse" } } | ||
| }, | ||
| "then": { | ||
| "$ref": "command_response.json" | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "required" : ["type"], | ||
| "properties": { "type": { "const": "StatusRequest" } } | ||
| }, | ||
| "then": { | ||
| "$ref": "status_request.json" | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "required" : ["type"], | ||
| "properties": { "type": { "const": "StatusResponse" } } | ||
| }, | ||
| "then": { | ||
| "$ref": "../3.2.0/status_response.json" | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "required" : ["type"], | ||
| "properties": { "type": { "const": "StatusSubscribe" } } | ||
| }, | ||
| "then": { | ||
| "$ref": "status_subscribe.json" | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "required" : ["type"], | ||
| "properties": { "type": { "const": "StatusUnsubscribe" } } | ||
| }, | ||
| "then": { | ||
| "$ref": "../3.1.2/status_unsubscribe.json" | ||
| } | ||
| }, | ||
| { | ||
| "if": { | ||
| "required" : ["type"], | ||
| "properties": { "type": { "const": "StatusUpdate" } } | ||
| }, | ||
| "then": { | ||
| "$ref": "../3.2.0/status_update.json" | ||
| } | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "properties" : { | ||
| "mId" : { "$ref": "definitions.json#/message_id" }, | ||
| "cId" : { "$ref": "definitions.json#/component_id" }, | ||
| "sS" : { | ||
| "description" : "Status request arguments", | ||
| "type" : "array", | ||
| "minItems": 1, | ||
| "items" : { | ||
| "type" : "object", | ||
| "properties": { | ||
| "sCI" : { "$ref": "definitions.json#/status_code" }, | ||
| "n" : { "description" : "Unique reference of the value", "type" : "string" } | ||
| }, | ||
| "required" : [ "sCI", "n" ], | ||
| "additionalProperties": false | ||
| } | ||
| } | ||
| }, | ||
| "required" : [ "mId", "cId", "sS"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "title" : "StatusRequest", | ||
| "description" : "Status request", | ||
| "$ref": "status.json" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "title" : "StatusSubscribe", | ||
| "description" : "Status subscribe", | ||
| "properties" : { | ||
| "mId" : { "$ref": "definitions.json#/message_id" }, | ||
| "cId" : { "$ref": "definitions.json#/component_id" }, | ||
| "sS" : { | ||
| "description" : "Status request arguments", | ||
| "type" : "array", | ||
| "minItems": 1, | ||
| "items" : { | ||
| "type" : "object", | ||
| "properties": { | ||
| "sCI" : { "$ref": "definitions.json#/status_code" }, | ||
| "n" : { "description" : "Unique reference of the value", "type" : "string" }, | ||
| "uRt" : { | ||
| "$ref": "definitions.json#/number_as_string", | ||
| "description" : "Update interval in seconds, 0 means send when value changes" | ||
| }, | ||
| "sOc" : { | ||
| "type": "boolean", | ||
| "description" : "Whether to send an update as soon as the value changes" | ||
| } | ||
| }, | ||
| "required" : [ "sCI", "n", "uRt", "sOc" ], | ||
| "additionalProperties": false | ||
| } | ||
| } | ||
| }, | ||
| "required" : [ "mId", "cId", "sS"] | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should not duplicate the entire definitions.json file, since and a few things changed. i suggest that this file only include the update definitions. then schema files can include both the old and this new one