blob: 37fe4925a9056f378066e258d69024e81bd11f50 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#!/bin/sh
2
3[ "$1" = python3-jsonschema ] || exit 0
4
5python3 - << 'EOF'
6
7from jsonschema import validate
8
9# A sample schema, like what we'd get from json.load()
10schema = {
11 "type" : "object",
12 "properties" : {
13 "price" : {"type" : "number"},
14 "name" : {"type" : "string"},
15 },
16}
17
18# If no exception is raised by validate(), the instance is valid.
19validate(instance={"name" : "Eggs", "price" : 34.99}, schema=schema)
20
21EOF