Mercurial > hg > piper
annotate json/check.sh @ 192:0898ffd47a10
Update examples for configuration request, load response, and rpc
response - I had overlooked these because their contained objects were
being validated against out-of-date online copies of schema
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Fri, 03 Feb 2017 15:58:21 +0000 |
parents | 549d3d44d729 |
children |
rev | line source |
---|---|
c@181 | 1 #!/bin/bash |
c@181 | 2 |
c@181 | 3 mydir=$(dirname "$0") |
c@181 | 4 |
c@181 | 5 set -eu |
c@181 | 6 |
c@181 | 7 echo |
c@181 | 8 |
c@181 | 9 for ex in "$mydir"/examples/*.json ; do |
c@181 | 10 echo "Checking $ex..." 1>&2 |
c@181 | 11 jsonschema -i "$ex" "$mydir"/schema/$(basename "$ex" | sed 's/-[^.]*//') |
c@181 | 12 done |
c@181 | 13 |
c@181 | 14 for s in "$mydir"/schema/*.json ; do |
c@181 | 15 if [ ! -f "$mydir"/examples/$(basename "$s") ]; then |
c@181 | 16 if ! ls -1 "$mydir"/examples/$(basename "$s" .json)-*.json >/dev/null 2>&1; then |
c@181 | 17 echo "WARNING: No example file for schema $s" |
c@181 | 18 fi |
c@181 | 19 fi |
c@181 | 20 done |
c@181 | 21 |
c@181 | 22 echo OK |