Skip to content

Instantly share code, notes, and snippets.

@jpmens
Created November 13, 2023 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpmens/363daff0995fc922c998b98a90362eca to your computer and use it in GitHub Desktop.
Save jpmens/363daff0995fc922c998b98a90362eca to your computer and use it in GitHub Desktop.
============= 01.json
{"_type":"cmd", "action":"reportLocation"}
ok -- validation done
The following files were checked:
01.json
============= 02.json
{"_type":"cmd", "action":"reportSteps"}
ok -- validation done
The following files were checked:
02.json
============= 03.json
{"_type":"cmd", "action":"dump"}
ok -- validation done
The following files were checked:
03.json
============= 04.json
{"_type":"cmd", "action":"waypoints"}
ok -- validation done
The following files were checked:
04.json
============= 05.json
{"_type":"cmd", "action":"clearWaypoints"}
ok -- validation done
The following files were checked:
05.json
============= 06.json
{"_type":"cmd", "action":"setConfiguration", "configuration":{"_type":"configuration","something": true}}
ok -- validation done
The following files were checked:
06.json
============= 07.json
{"_type":"cmd", "action":"setWaypoints", "waypoints":{"_type":"waypoints","waypoints":["bla"]}}
ok -- validation done
The following files were checked:
07.json
============= 08.json
{"_type":"cmd", "action":"action", "content":"Backend maintenance scheduled for tonight\n\nhttp://support.owntracks.org"}
ok -- validation done
The following files were checked:
08.json
============= 09.json
{"_type":"cmd", "action":"action", "content":"<a href='http://support.owntracks.org'>Backend Maintenance tonight</a>"}
ok -- validation done
The following files were checked:
09.json
============= 10.json
{"_type":"cmd", "action":"action", "url":"http://support.owntracks.org"}
ok -- validation done
The following files were checked:
10.json
============= 11.json
{"_type":"cmd", "action":"action", "notification":"Warning! Battery low"}
ok -- validation done
The following files were checked:
11.json
============= 12.json
{"_type":"cmd", "action":"action", "drink":"G&T; should fail validation"}
Schema validation errors were encountered.
12.json::$: {'_type': 'cmd', 'action': 'action', 'drink': 'G&T; should fail validation'} is not valid under any of the given schemas
Underlying errors caused this.
Best Match:
$: 'content' is a required property
All Errors:
$: 'content' is a required property
$: 'url' is a required property
$: 'notification' is a required property
============= 13.json
{"_type":"cmd", "action":"sleep", "reason":"Battery low; should FAIL"}
Schema validation errors were encountered.
13.json::$.action: 'sleep' is not one of ['reportLocation', 'reportSteps', 'dump', 'waypoints', 'clearWaypoints', 'setConfiguration', 'setWaypoints', 'action']
============= 14.json
{"_type":"cmd", "action":"eatDinner"}
Schema validation errors were encountered.
14.json::$.action: 'eatDinner' is not one of ['reportLocation', 'reportSteps', 'dump', 'waypoints', 'clearWaypoints', 'setConfiguration', 'setWaypoints', 'action']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment