jspg progress
This commit is contained in:
119
tests/fixtures/emptyString.json
vendored
Normal file
119
tests/fixtures/emptyString.json
vendored
Normal file
@ -0,0 +1,119 @@
|
||||
[
|
||||
{
|
||||
"description": "empty string is valid for all types (except const)",
|
||||
"schema": {
|
||||
"$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
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user