From a0de75862b8cc5400c2ce7f24d4aed523b529a20 Mon Sep 17 00:00:00 2001 From: creme332 <65414576+creme332@users.noreply.github.com> Date: Sat, 18 May 2024 13:45:15 +0400 Subject: [PATCH] define $schema, define schema at root level instead of nested --- resources/schema/Administrator.json | 41 +++++++++++---------- resources/schema/Client.json | 55 ++++++++++++++--------------- 2 files changed, 47 insertions(+), 49 deletions(-) diff --git a/resources/schema/Administrator.json b/resources/schema/Administrator.json index c91b4d9..e95359e 100644 --- a/resources/schema/Administrator.json +++ b/resources/schema/Administrator.json @@ -1,24 +1,23 @@ { - "administrator": { - "allOf": [ - { - "$ref": "User.json#/definitions/user" - }, - { - "type": "object", - "properties": { - "job_title": { - "type": "string", - "minLength": 4 - }, - "is_super_admin": { - "type": "boolean" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "allOf": [ + { + "$ref": "User.json#/definitions/user" + }, + { + "type": "object", + "properties": { + "job_title": { + "type": "string", + "minLength": 4 }, - "required": [ - "job_title" - ] - } - ] - } + "is_super_admin": { + "type": "boolean" + } + }, + "required": [ + "job_title" + ] + } + ] } diff --git a/resources/schema/Client.json b/resources/schema/Client.json index 8b23aae..842b165 100644 --- a/resources/schema/Client.json +++ b/resources/schema/Client.json @@ -1,31 +1,30 @@ { - "client": { - "allOf": [ - { - "$ref": "User.json#/definitions/user" - }, - { - "type": "object", - "properties": { - "street": { - "type": "string", - "minLength": 4 - }, - "city": { - "type": "string", - "minLength": 3 - }, - "district_id": { - "type": "integer", - "minimum": 1 - } + "$schema": "http://json-schema.org/draft-07/schema#", + "allOf": [ + { + "$ref": "User.json#/definitions/user" + }, + { + "type": "object", + "properties": { + "street": { + "type": "string", + "minLength": 4 + }, + "city": { + "type": "string", + "minLength": 3 }, - "required": [ - "street", - "city", - "district_id" - ] - } - ] - } + "district_id": { + "type": "integer", + "minimum": 1 + } + }, + "required": [ + "street", + "city", + "district_id" + ] + } + ] }