mirror of
https://github.com/openwrt/packages.git
synced 2025-01-31 04:51:44 +00:00
36eb48465b
This also adds a test.sh script for the packages feed CI. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
22 lines
442 B
Bash
22 lines
442 B
Bash
#!/bin/sh
|
|
|
|
[ "$1" = python3-jsonschema ] || exit 0
|
|
|
|
python3 - << 'EOF'
|
|
|
|
from jsonschema import validate
|
|
|
|
# A sample schema, like what we'd get from json.load()
|
|
schema = {
|
|
"type" : "object",
|
|
"properties" : {
|
|
"price" : {"type" : "number"},
|
|
"name" : {"type" : "string"},
|
|
},
|
|
}
|
|
|
|
# If no exception is raised by validate(), the instance is valid.
|
|
validate(instance={"name" : "Eggs", "price" : 34.99}, schema=schema)
|
|
|
|
EOF
|