The jsonschema package is part of of the API of the mcp package, so it should not be internal. Change-Id: I9520797837329fc2cda09c2f46ec4d48d031b9d3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/669996 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Findley <rfindley@google.com>
55 lines
1.4 KiB
JSON
55 lines
1.4 KiB
JSON
[
|
|
{
|
|
"description": "minLength validation",
|
|
"schema": {
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"minLength": 2
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "longer is valid",
|
|
"data": "foo",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "exact length is valid",
|
|
"data": "fo",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "too short is invalid",
|
|
"data": "f",
|
|
"valid": false
|
|
},
|
|
{
|
|
"description": "ignores non-strings",
|
|
"data": 1,
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "one grapheme is not long enough",
|
|
"data": "\uD83D\uDCA9",
|
|
"valid": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "minLength validation with a decimal",
|
|
"schema": {
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"minLength": 2.0
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "longer is valid",
|
|
"data": "foo",
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "too short is invalid",
|
|
"data": "f",
|
|
"valid": false
|
|
}
|
|
]
|
|
}
|
|
]
|