From 123e941aec3b70e169b06615f0deecd84503a04b Mon Sep 17 00:00:00 2001 From: William Veal Phan Date: Thu, 20 Oct 2022 16:15:03 +0200 Subject: [PATCH] conf(allowlist): add json-schema --- allowlist.json | 1 + allowlist.schema.json | 81 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 allowlist.schema.json diff --git a/allowlist.json b/allowlist.json index 2da1c37..aa6ec06 100644 --- a/allowlist.json +++ b/allowlist.json @@ -1,4 +1,5 @@ { + "$schema": "./allowlist.schema.json", "allowlist": { "ethereum": [ { diff --git a/allowlist.schema.json b/allowlist.schema.json new file mode 100644 index 0000000..89370e3 --- /dev/null +++ b/allowlist.schema.json @@ -0,0 +1,81 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/root", + "definitions": { + "root": { + "type": "object", + "additionalProperties": false, + "properties": { + "allowlist": { + "$ref": "#/definitions/Allowlist" + }, + "$schema": { + "type": "string" + } + }, + "required": [ + "allowlist", + "$schema" + ], + "title": "root" + }, + "Allowlist": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/Dapp" + } + }, + "title": "Allowlist" + }, + "Dapp": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + }, + "domain": { + "type": "string" + }, + "token": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "string" + } + ] + }, + "contracts": { + "type": "array", + "items": { + "$ref": "#/definitions/Contract" + } + } + }, + "required": [ + "contracts", + "domain", + "name", + "token" + ], + "title": "Dapp" + }, + "Contract": { + "type": "object", + "additionalProperties": false, + "properties": { + "address": { + "type": "string" + } + }, + "required": [ + "address" + ], + "title": "Contract" + } + } +} \ No newline at end of file