Debian Codegraph @

spec/JSON-Schema-Test-Suite/tests/draft2020-12/optional/format/ipv4.json

raw ◀ ▶
2 Debian patches touch this file
•1 [
2 {
3 "description": "validation of IP addresses",
4 "schema": { "format": "ipv4" },
5 "tests": [
6 {
7 "description": "all string formats ignore integers",
8 "data": 12,
9 "valid": true
10 },
11 {
12 "description": "all string formats ignore floats",
13 "data": 13.7,
14 "valid": true
15 },
16 {
17 "description": "all string formats ignore objects",
18 "data": {},
19 "valid": true
20 },
21 {
22 "description": "all string formats ignore arrays",
23 "data": [],
24 "valid": true
25 },
26 {
27 "description": "all string formats ignore booleans",
28 "data": false,
29 "valid": true
30 },
31 {
32 "description": "all string formats ignore nulls",
33 "data": null,
34 "valid": true
35 },
36 {
37 "description": "a valid IP address",
38 "data": "192.168.0.1",
39 "valid": true
40 },
41 {
42 "description": "an IP address with too many components",
43 "data": "127.0.0.0.1",
44 "valid": false
45 },
46 {
47 "description": "an IP address with out-of-range values",
48 "data": "256.256.256.256",
49 "valid": false
50 },
51 {
52 "description": "an IP address without 4 components",
53 "data": "127.0",
54 "valid": false
55 },
56 {
57 "description": "an IP address as an integer",
58 "data": "0x7f000001",
59 "valid": false
60 },
61 {
62 "description": "an IP address as an integer (decimal)",
63 "data": "2130706433",
64 "valid": false
65 },
66 {
67 "description": "value without leading zero is valid",
68 "data": "87.10.0.1",
69 "valid": true
70 },
71 {
72 "description": "non-ascii digits should be rejected",
73 "data": "1২7.0.0.1",
74 "valid": false
75 }
76 ]
77 }
78 ]