Skip to content

Commit 6e0e835

Browse files
authored
Implement a schema for IPv4 addresses (#2)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent 5c71c23 commit 6e0e835

2 files changed

Lines changed: 465 additions & 0 deletions

File tree

schemas/ietf/ip/v4/address.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "RFC 3986 IPv4 Address",
4+
"description": "An Internet Protocol version 4 address in dotted-decimal notation",
5+
"$comment": "https://www.rfc-editor.org/rfc/rfc3986#section-3.2.2",
6+
"examples": [
7+
"0.0.0.0",
8+
"127.0.0.1",
9+
"192.168.1.1",
10+
"255.255.255.255",
11+
"10.0.0.1"
12+
],
13+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
14+
"type": "string",
15+
"pattern": "^([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$",
16+
"format": "ipv4"
17+
}

0 commit comments

Comments
 (0)