From 7743cebae356951f834b0da5e2ff3e80969fb59f Mon Sep 17 00:00:00 2001 From: Sebastian Frank Date: Tue, 16 Aug 2022 10:24:45 +0200 Subject: [PATCH] schema fieldArray --- schemas/api-config/collection.json | 58 +++++++++++++++++------------- schemas/api-config/field.json | 3 +- schemas/api-config/fieldArray.json | 17 +++++++++ 3 files changed, 53 insertions(+), 25 deletions(-) create mode 100644 schemas/api-config/fieldArray.json diff --git a/schemas/api-config/collection.json b/schemas/api-config/collection.json index d818fa5..33e90b0 100644 --- a/schemas/api-config/collection.json +++ b/schemas/api-config/collection.json @@ -173,34 +173,44 @@ ] }, "fields": { - "type": "array", - "description": "fields of collection", - "items": { - "oneOf": [ - { - "$comment": "for include tag", - "type": "string" - }, - { - "$ref": "field.json" + "oneOf": [ + { "$comment": "for include tag", "type": "string" }, + { + "type": "array", + "description": "fields of collection", + "items": { + "oneOf": [ + { + "$comment": "for include tag", + "type": "string" + }, + { + "$ref": "field.json" + } + ] } - ] - } + } + ] }, "indexes": { - "type": "array", - "description": "indexes of collection", - "items": { - "oneOf": [ - { - "$comment": "for include tag", - "type": "string" - }, - { - "$ref": "index.json" + "oneOf": [ + { "$comment": "for include tag", "type": "string" }, + { + "type": "array", + "description": "indexes of collection", + "items": { + "oneOf": [ + { + "$comment": "for include tag", + "type": "string" + }, + { + "$ref": "index.json" + } + ] } - ] - } + } + ] } }, "required": ["name", "permissions"] diff --git a/schemas/api-config/field.json b/schemas/api-config/field.json index d83fea5..f6b21aa 100644 --- a/schemas/api-config/field.json +++ b/schemas/api-config/field.json @@ -66,7 +66,8 @@ "selectArray", "date", "file", - "image" + "image", + "jsonField" ] }, "choices": { diff --git a/schemas/api-config/fieldArray.json b/schemas/api-config/fieldArray.json new file mode 100644 index 0000000..91fe7f1 --- /dev/null +++ b/schemas/api-config/fieldArray.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "JSON Schema tibi-server field array configuration", + "description": "tibi-server collection linter", + "type": "array", + "items": { + "oneOf": [ + { + "$comment": "for include tag", + "type": "string" + }, + { + "$ref": "field.json" + } + ] + } +}