12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- [
- {
- "description": "extends",
- "schema": {
- "properties": {"bar": {"type": "integer", "required": true}},
- "extends": {
- "properties": {
- "foo": {"type": "string", "required": true}
- }
- }
- },
- "tests": [
- {
- "description": "extends",
- "data": {"foo": "baz", "bar": 2},
- "valid": true
- },
- {
- "description": "mismatch extends",
- "data": {"foo": "baz"},
- "valid": false
- },
- {
- "description": "mismatch extended",
- "data": {"bar": 2},
- "valid": false
- },
- {
- "description": "wrong type",
- "data": {"foo": "baz", "bar": "quux"},
- "valid": false
- }
- ]
- },
- {
- "description": "multiple extends",
- "schema": {
- "properties": {"bar": {"type": "integer", "required": true}},
- "extends" : [
- {
- "properties": {
- "foo": {"type": "string", "required": true}
- }
- },
- {
- "properties": {
- "baz": {"type": "null", "required": true}
- }
- }
- ]
- },
- "tests": [
- {
- "description": "valid",
- "data": {"foo": "quux", "bar": 2, "baz": null},
- "valid": true
- },
- {
- "description": "mismatch first extends",
- "data": {"bar": 2, "baz": null},
- "valid": false
- },
- {
- "description": "mismatch second extends",
- "data": {"foo": "quux", "bar": 2},
- "valid": false
- },
- {
- "description": "mismatch both",
- "data": {"bar": 2},
- "valid": false
- }
- ]
- },
- {
- "description": "extends simple types",
- "schema": {
- "minimum": 20,
- "extends": {"maximum": 30}
- },
- "tests": [
- {
- "description": "valid",
- "data": 25,
- "valid": true
- },
- {
- "description": "mismatch extends",
- "data": 35,
- "valid": false
- }
- ]
- }
- ]
|