| { |
| "$schema": "http://json-schema.org/draft-04/schema#", |
| "title": "Security definitions schema", |
| "type": "object", |
| "properties": { |
| "type": { |
| "type": "string" |
| }, |
| "inherits-from": { |
| "type": "array", |
| "items": { |
| "type": "string" |
| } |
| } |
| }, |
| "required": ["type"], |
| "additionalProperties": false, |
| "tests": [ |
| { |
| "id": "VALID_1", |
| "description": "type and inherits-from", |
| "data": { |
| "type": "customType", |
| "inherits-from": ["string1", "string2"] |
| }, |
| "valid": true |
| }, |
| { |
| "id": "VALID_2", |
| "description": "only type", |
| "data": { |
| "type": "customType" |
| }, |
| "valid": true |
| }, |
| { |
| "id": "VALID_3", |
| "description": "type and empty inherits-from", |
| "data": { |
| "type": "pii", |
| "inherits-from": [] |
| }, |
| "valid": true |
| }, |
| { |
| "id": "INVALID_1", |
| "description": "type not of string type", |
| "data": { |
| "type": 1 |
| }, |
| "valid": false |
| }, |
| { |
| "id": "INVALID_2", |
| "description": "inherits-from not of list type", |
| "data": { |
| "type": "customType1", |
| "inherits-from": "customType2" |
| }, |
| "valid": false |
| }, |
| { |
| "id": "INVALID_3", |
| "description": "Required field 'type' not given", |
| "data": {}, |
| "valid": false |
| }, |
| { |
| "id": "INVALID_4", |
| "description": "Additional field present", |
| "data": { |
| "type": "customType", |
| "customField": "customString" |
| }, |
| "valid": false |
| } |
| ] |
| } |