-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
validate
not checking the metaschema without -m
given no inst…
…ances See: asyncapi/spec-json-schemas#549 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
- Loading branch information
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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,29 @@ | ||
#!/bin/sh | ||
|
||
set -o errexit | ||
set -o nounset | ||
|
||
TMP="$(mktemp -d)" | ||
clean() { rm -rf "$TMP"; } | ||
trap clean EXIT | ||
|
||
cat << 'EOF' > "$TMP/schema.json" | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"properties": { | ||
"foo": { | ||
"type": 1 | ||
} | ||
} | ||
} | ||
EOF | ||
|
||
"$1" validate "$TMP/schema.json" && CODE="$?" || CODE="$?" | ||
|
||
if [ "$CODE" = "0" ] | ||
then | ||
echo "FAIL" 1>&2 | ||
exit 1 | ||
else | ||
echo "PASS" 1>&2 | ||
fi |