cuelang.org/go@v0.13.0/encoding/jsonschema/testdata/external/tests/draft4/not.json (about) 1 [ 2 { 3 "description": "not", 4 "schema": { 5 "not": { 6 "type": "integer" 7 } 8 }, 9 "tests": [ 10 { 11 "description": "allowed", 12 "data": "foo", 13 "valid": true 14 }, 15 { 16 "description": "disallowed", 17 "data": 1, 18 "valid": false 19 } 20 ] 21 }, 22 { 23 "description": "not multiple types", 24 "schema": { 25 "not": { 26 "type": [ 27 "integer", 28 "boolean" 29 ] 30 } 31 }, 32 "tests": [ 33 { 34 "description": "valid", 35 "data": "foo", 36 "valid": true 37 }, 38 { 39 "description": "mismatch", 40 "data": 1, 41 "valid": false 42 }, 43 { 44 "description": "other mismatch", 45 "data": true, 46 "valid": false 47 } 48 ] 49 }, 50 { 51 "description": "not more complex schema", 52 "schema": { 53 "not": { 54 "type": "object", 55 "properties": { 56 "foo": { 57 "type": "string" 58 } 59 } 60 } 61 }, 62 "tests": [ 63 { 64 "description": "match", 65 "data": 1, 66 "valid": true 67 }, 68 { 69 "description": "other match", 70 "data": { 71 "foo": 1 72 }, 73 "valid": true 74 }, 75 { 76 "description": "mismatch", 77 "data": { 78 "foo": "bar" 79 }, 80 "valid": false 81 } 82 ] 83 }, 84 { 85 "description": "forbidden property", 86 "schema": { 87 "properties": { 88 "foo": { 89 "not": {} 90 } 91 } 92 }, 93 "tests": [ 94 { 95 "description": "property present", 96 "data": { 97 "foo": 1, 98 "bar": 2 99 }, 100 "valid": false 101 }, 102 { 103 "description": "property absent", 104 "data": { 105 "bar": 1, 106 "baz": 2 107 }, 108 "valid": true 109 } 110 ] 111 }, 112 { 113 "description": "forbid everything with empty schema", 114 "schema": { 115 "not": {} 116 }, 117 "tests": [ 118 { 119 "description": "number is invalid", 120 "data": 1, 121 "valid": false 122 }, 123 { 124 "description": "string is invalid", 125 "data": "foo", 126 "valid": false 127 }, 128 { 129 "description": "boolean true is invalid", 130 "data": true, 131 "valid": false 132 }, 133 { 134 "description": "boolean false is invalid", 135 "data": false, 136 "valid": false 137 }, 138 { 139 "description": "null is invalid", 140 "data": null, 141 "valid": false 142 }, 143 { 144 "description": "object is invalid", 145 "data": { 146 "foo": "bar" 147 }, 148 "valid": false 149 }, 150 { 151 "description": "empty object is invalid", 152 "data": {}, 153 "valid": false 154 }, 155 { 156 "description": "array is invalid", 157 "data": [ 158 "foo" 159 ], 160 "valid": false 161 }, 162 { 163 "description": "empty array is invalid", 164 "data": [], 165 "valid": false 166 } 167 ] 168 }, 169 { 170 "description": "double negation", 171 "schema": { 172 "not": { 173 "not": {} 174 } 175 }, 176 "tests": [ 177 { 178 "description": "any value is valid", 179 "data": "foo", 180 "valid": true 181 } 182 ] 183 } 184 ]