123 lines
3.6 KiB
JSON
123 lines
3.6 KiB
JSON
[
|
|
{
|
|
"description": "empty string is valid for all types (except const)",
|
|
"database": {
|
|
"schemas": [
|
|
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"properties": {
|
|
"obj": {
|
|
"type": "object"
|
|
},
|
|
"arr": {
|
|
"type": "array"
|
|
},
|
|
"str": {
|
|
"type": "string"
|
|
},
|
|
"int": {
|
|
"type": "integer"
|
|
},
|
|
"num": {
|
|
"type": "number"
|
|
},
|
|
"bool": {
|
|
"type": "boolean"
|
|
},
|
|
"nul": {
|
|
"type": "null"
|
|
},
|
|
"fmt": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
},
|
|
"con": {
|
|
"const": "value"
|
|
},
|
|
"con_empty": {
|
|
"const": ""
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "empty string valid for object",
|
|
"data": {
|
|
"obj": ""
|
|
},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "empty string valid for array",
|
|
"data": {
|
|
"arr": ""
|
|
},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "empty string valid for string",
|
|
"data": {
|
|
"str": ""
|
|
},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "empty string valid for integer",
|
|
"data": {
|
|
"int": ""
|
|
},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "empty string valid for number",
|
|
"data": {
|
|
"num": ""
|
|
},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "empty string valid for boolean",
|
|
"data": {
|
|
"bool": ""
|
|
},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "empty string valid for null",
|
|
"data": {
|
|
"nul": ""
|
|
},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "empty string valid for format",
|
|
"data": {
|
|
"fmt": ""
|
|
},
|
|
"valid": true
|
|
},
|
|
{
|
|
"description": "empty string INVALID for const (unless const is empty string)",
|
|
"data": {
|
|
"con": ""
|
|
},
|
|
"valid": false,
|
|
"expect_errors": [
|
|
{
|
|
"code": "CONST_VIOLATED",
|
|
"path": "/con"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "empty string VALID for const if const IS empty string",
|
|
"data": {
|
|
"con_empty": ""
|
|
},
|
|
"valid": true
|
|
}
|
|
]
|
|
}
|
|
] |