From 4d7e6ded11991b2598f07dba126a9258f15cbf76 Mon Sep 17 00:00:00 2001 From: psyirius Date: Wed, 7 Aug 2024 06:27:05 -0700 Subject: [PATCH] added json-schema for config/dns.json --- config/dns.json | 1 + schemas/config/dns.json | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 schemas/config/dns.json diff --git a/config/dns.json b/config/dns.json index 6c2ffbbd..e31fa0bf 100644 --- a/config/dns.json +++ b/config/dns.json @@ -1,4 +1,5 @@ { + "$schema": "../schemas/config/dns.json", "Google":{ "Primary": "8.8.8.8", "Secondary": "8.8.4.4", diff --git a/schemas/config/dns.json b/schemas/config/dns.json new file mode 100644 index 00000000..6fa17efc --- /dev/null +++ b/schemas/config/dns.json @@ -0,0 +1,28 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "patternProperties": { + "^[a-zA-Z_][a-zA-Z0-9_]*$": { + "type": "object", + "properties": { + "Primary": { + "type": "string", + "format": "ipv4" + }, + "Secondary": { + "type": "string", + "format": "ipv4" + }, + "Primary6": { + "type": "string", + "format": "ipv6" + }, + "Secondary6": { + "type": "string", + "format": "ipv6" + } + }, + "required": ["Primary", "Secondary", "Primary6", "Secondary6"] + } + } +}