Merge commit '45cf1fb8a6a0b7ea1ab8de8ea9fc7addb0ffd149'

* commit '45cf1fb8a6a0b7ea1ab8de8ea9fc7addb0ffd149':
  Squashed 'json/' changes from 3cef243..9208016
This commit is contained in:
Julian Berman 2014-12-07 12:22:37 -05:00
commit 62e942ea37
No known key found for this signature in database
GPG Key ID: 3F8D9C8C011729F8
3 changed files with 99 additions and 0 deletions

View File

@ -76,6 +76,7 @@ This suite is being used by:
* [json_schema (Dart)](https://github.com/patefacio/json_schema)
* [tv4 (JavaScript)](https://github.com/geraintluff/tv4)
* [Jsonary (JavaScript)](https://github.com/jsonary-js/jsonary)
* [json-schema (Ruby)](https://github.com/hoxworth/json-schema)
If you use it as well, please fork and send a pull request adding yourself to
the list :).

View File

@ -0,0 +1,49 @@
[
{
"description": "invalid type for default",
"schema": {
"properties": {
"foo": {
"type": "integer",
"default": []
}
}
},
"tests": [
{
"description": "valid when property is specified",
"data": {"foo": 13},
"valid": true
},
{
"description": "still valid when the invalid default is used",
"data": {},
"valid": true
}
]
},
{
"description": "invalid string value for default",
"schema": {
"properties": {
"bar": {
"type": "string",
"minLength": 4,
"default": "bad"
}
}
},
"tests": [
{
"description": "valid when property is specified",
"data": {"bar": "good"},
"valid": true
},
{
"description": "still valid when the invalid default is used",
"data": {},
"valid": true
}
]
}
]

View File

@ -0,0 +1,49 @@
[
{
"description": "invalid type for default",
"schema": {
"properties": {
"foo": {
"type": "integer",
"default": []
}
}
},
"tests": [
{
"description": "valid when property is specified",
"data": {"foo": 13},
"valid": true
},
{
"description": "still valid when the invalid default is used",
"data": {},
"valid": true
}
]
},
{
"description": "invalid string value for default",
"schema": {
"properties": {
"bar": {
"type": "string",
"minLength": 4,
"default": "bad"
}
}
},
"tests": [
{
"description": "valid when property is specified",
"data": {"bar": "good"},
"valid": true
},
{
"description": "still valid when the invalid default is used",
"data": {},
"valid": true
}
]
}
]