github.com/kaptinlin/jsonschema@v0.4.6/testdata/JSON-Schema-Test-Suite/tests/draft2019-09/optional/format/ipv6.json (about) 1 [ 2 { 3 "description": "validation of IPv6 addresses", 4 "schema": { 5 "$schema": "https://json-schema.org/draft/2019-09/schema", 6 "format": "ipv6" 7 }, 8 "tests": [ 9 { 10 "description": "all string formats ignore integers", 11 "data": 12, 12 "valid": true 13 }, 14 { 15 "description": "all string formats ignore floats", 16 "data": 13.7, 17 "valid": true 18 }, 19 { 20 "description": "all string formats ignore objects", 21 "data": {}, 22 "valid": true 23 }, 24 { 25 "description": "all string formats ignore arrays", 26 "data": [], 27 "valid": true 28 }, 29 { 30 "description": "all string formats ignore booleans", 31 "data": false, 32 "valid": true 33 }, 34 { 35 "description": "all string formats ignore nulls", 36 "data": null, 37 "valid": true 38 }, 39 { 40 "description": "a valid IPv6 address", 41 "data": "::1", 42 "valid": true 43 }, 44 { 45 "description": "an IPv6 address with out-of-range values", 46 "data": "12345::", 47 "valid": false 48 }, 49 { 50 "description": "trailing 4 hex symbols is valid", 51 "data": "::abef", 52 "valid": true 53 }, 54 { 55 "description": "trailing 5 hex symbols is invalid", 56 "data": "::abcef", 57 "valid": false 58 }, 59 { 60 "description": "an IPv6 address with too many components", 61 "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1", 62 "valid": false 63 }, 64 { 65 "description": "an IPv6 address containing illegal characters", 66 "data": "::laptop", 67 "valid": false 68 }, 69 { 70 "description": "no digits is valid", 71 "data": "::", 72 "valid": true 73 }, 74 { 75 "description": "leading colons is valid", 76 "data": "::42:ff:1", 77 "valid": true 78 }, 79 { 80 "description": "trailing colons is valid", 81 "data": "d6::", 82 "valid": true 83 }, 84 { 85 "description": "missing leading octet is invalid", 86 "data": ":2:3:4:5:6:7:8", 87 "valid": false 88 }, 89 { 90 "description": "missing trailing octet is invalid", 91 "data": "1:2:3:4:5:6:7:", 92 "valid": false 93 }, 94 { 95 "description": "missing leading octet with omitted octets later", 96 "data": ":2:3:4::8", 97 "valid": false 98 }, 99 { 100 "description": "single set of double colons in the middle is valid", 101 "data": "1:d6::42", 102 "valid": true 103 }, 104 { 105 "description": "two sets of double colons is invalid", 106 "data": "1::d6::42", 107 "valid": false 108 }, 109 { 110 "description": "mixed format with the ipv4 section as decimal octets", 111 "data": "1::d6:192.168.0.1", 112 "valid": true 113 }, 114 { 115 "description": "mixed format with double colons between the sections", 116 "data": "1:2::192.168.0.1", 117 "valid": true 118 }, 119 { 120 "description": "mixed format with ipv4 section with octet out of range", 121 "data": "1::2:192.168.256.1", 122 "valid": false 123 }, 124 { 125 "description": "mixed format with ipv4 section with a hex octet", 126 "data": "1::2:192.168.ff.1", 127 "valid": false 128 }, 129 { 130 "description": "mixed format with leading double colons (ipv4-mapped ipv6 address)", 131 "data": "::ffff:192.168.0.1", 132 "valid": true 133 }, 134 { 135 "description": "triple colons is invalid", 136 "data": "1:2:3:4:5:::8", 137 "valid": false 138 }, 139 { 140 "description": "8 octets", 141 "data": "1:2:3:4:5:6:7:8", 142 "valid": true 143 }, 144 { 145 "description": "insufficient octets without double colons", 146 "data": "1:2:3:4:5:6:7", 147 "valid": false 148 }, 149 { 150 "description": "no colons is invalid", 151 "data": "1", 152 "valid": false 153 }, 154 { 155 "description": "ipv4 is not ipv6", 156 "data": "127.0.0.1", 157 "valid": false 158 }, 159 { 160 "description": "ipv4 segment must have 4 octets", 161 "data": "1:2:3:4:1.2.3", 162 "valid": false 163 }, 164 { 165 "description": "leading whitespace is invalid", 166 "data": " ::1", 167 "valid": false 168 }, 169 { 170 "description": "trailing whitespace is invalid", 171 "data": "::1 ", 172 "valid": false 173 }, 174 { 175 "description": "netmask is not a part of ipv6 address", 176 "data": "fe80::/64", 177 "valid": false 178 }, 179 { 180 "description": "zone id is not a part of ipv6 address", 181 "data": "fe80::a%eth1", 182 "valid": false 183 }, 184 { 185 "description": "a long valid ipv6", 186 "data": "1000:1000:1000:1000:1000:1000:255.255.255.255", 187 "valid": true 188 }, 189 { 190 "description": "a long invalid ipv6, below length limit, first", 191 "data": "100:100:100:100:100:100:255.255.255.255.255", 192 "valid": false 193 }, 194 { 195 "description": "a long invalid ipv6, below length limit, second", 196 "data": "100:100:100:100:100:100:100:255.255.255.255", 197 "valid": false 198 }, 199 { 200 "description": "invalid non-ASCII '৪' (a Bengali 4)", 201 "data": "1:2:3:4:5:6:7:৪", 202 "valid": false 203 }, 204 { 205 "description": "invalid non-ASCII '৪' (a Bengali 4) in the IPv4 portion", 206 "data": "1:2::192.16৪.0.1", 207 "valid": false 208 } 209 ] 210 } 211 ]