Skip to content

Commit f5f481a

Browse files
committed
Decimal IPs are also not dotted-quad
Per JSON Schema spec, only dotted-quad ips are allowed in ipv4 format. The tests verified that hex format is not valid here, but they didn't do the same for decimal format. Added that missing test. 2130706433 == 0x7f000001 == 127.0.0.1
1 parent 817b724 commit f5f481a

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

tests/draft2019-09/optional/format/ipv4.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
"description": "an IP address as an integer",
2828
"data": "0x7f000001",
2929
"valid": false
30+
},
31+
{
32+
"description": "an IP address as an integer (decimal)",
33+
"data": "2130706433",
34+
"valid": false
3035
}
3136
]
3237
}

tests/draft4/optional/format/ipv4.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
"description": "an IP address as an integer",
2828
"data": "0x7f000001",
2929
"valid": false
30+
},
31+
{
32+
"description": "an IP address as an integer (decimal)",
33+
"data": "2130706433",
34+
"valid": false
3035
}
3136
]
3237
}

tests/draft6/optional/format/ipv4.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
"description": "an IP address as an integer",
2828
"data": "0x7f000001",
2929
"valid": false
30+
},
31+
{
32+
"description": "an IP address as an integer (decimal)",
33+
"data": "2130706433",
34+
"valid": false
3035
}
3136
]
3237
}

tests/draft7/optional/format/ipv4.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
"description": "an IP address as an integer",
2828
"data": "0x7f000001",
2929
"valid": false
30+
},
31+
{
32+
"description": "an IP address as an integer (decimal)",
33+
"data": "2130706433",
34+
"valid": false
3035
}
3136
]
3237
}

0 commit comments

Comments
 (0)