Skip to content

Commit

Permalink
fix: valid JSON schema for JSON time objects
Browse files Browse the repository at this point in the history
  • Loading branch information
rhwood committed Mar 10, 2019
1 parent 7110bf5 commit c0d4bbc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 45 deletions.
20 changes: 8 additions & 12 deletions java/src/jmri/server/json/time/time-client.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,22 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "jmri-json-reporter-client-message",
"type": "object",
"description": "Schema data object in message from client to JMRI for type \"reporter\"",
"description": "Schema data object in message from client to JMRI for type \"time\"",
"properties": {
"name": {
"time": {
"type": "string",
"description": "System name of the reporter"
"description": "If present, set the fast clock time to the provided ISO 8601 time"
},
"userName": {
"type": "string",
"description": "If present, set the user name of the reporter"
},
"comment": {
"type": "string",
"description": "If present, set the comment for the reporter"
"rate": {
"type": "number",
"description": "If present, set the rate for the fast clock"
},
"state": {
"type": "integer",
"description": "If present, sets the state of the reporter",
"description": "If present, sets the state of the fast clock",
"enum": [0, 2, 4]
}
},
"additionalProperties": false,
"required": ["name"]
"required": []
}
43 changes: 10 additions & 33 deletions java/src/jmri/server/json/time/time-server.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,23 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "jmri-json-reporter-server-message",
"title": "jmri-json-time-server-message",
"type": "object",
"description": "Data portion of message from JMRI to client for type \"reporter\"",
"description": "Data portion of message from JMRI to client for type \"time\"",
"properties": {
"name": {
"time": {
"type": "string",
"description": "System name of the reporter"
"description": "Reported time in ISO 8601 format"
},
"userName": {
"type": "string",
"description": "User name of the reporter"
},
"comment": {
"type": "string",
"description": "Comment for the reporter"
},
"properties": {
"type": "array",
"description": "NamedBean properties of the reporter",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"description": "Key by which property is accessed"
},
"value": {
"type": ["string", "null"],
"description": "String value of property or null"
}
},
"additionalProperties": false,
"required": ["name", "value"]
}
"rate": {
"type": "number",
"description": "Fast clock rate"
},
"state": {
"type": "integer",
"description": "The state of the reporter",
"enum": [0, 2, 4, 8]
"description": "The state of the fast clock",
"enum": [0, 2, 4]
}
},
"additionalProperties": false,
"required": ["name", "userName", "comment", "properties", "state"]
"required": ["time", "rate", "state"]
}

0 comments on commit c0d4bbc

Please sign in to comment.