From e7d9222f6f3a4ce9f69ae086e4ed937b38d59fcc Mon Sep 17 00:00:00 2001 From: DafyddLlyr Date: Wed, 16 Aug 2023 13:27:48 +0000 Subject: [PATCH] Add build files for version --- schema.json | 253 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 schema.json diff --git a/schema.json b/schema.json new file mode 100644 index 00000000..e61e095e --- /dev/null +++ b/schema.json @@ -0,0 +1,253 @@ +{ + "$id": "DigitalPlanningDataSchema", + "$ref": "#/definitions/Schema", + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "Applicant": { + "$id": "Applicant", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "Application": { + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "DateTime": { + "format": "date-time", + "type": "string" + }, + "File": { + "additionalProperties": false, + "examples": [ + { + "size": "10mb" + } + ], + "properties": { + "foo": { + "enum": [ + "bar", + "baz", + "boo" + ], + "type": "string" + }, + "size": { + "type": "string" + } + }, + "required": [ + "size", + "foo" + ], + "type": "object" + }, + "Metadata": { + "additionalProperties": false, + "properties": { + "service": { + "additionalProperties": false, + "description": "Details of the digital planning service which generated this payload", + "properties": { + "name": { + "type": "string" + }, + "owner": { + "type": "string" + }, + "publishedFlowId": { + "$ref": "#/definitions/UUID" + }, + "url": { + "$ref": "#/definitions/URL" + } + }, + "required": [ + "publishedFlowId", + "name", + "owner", + "url" + ], + "type": "object" + }, + "session": { + "additionalProperties": false, + "properties": { + "createdAt": { + "$ref": "#/definitions/DateTime" + }, + "id": { + "$ref": "#/definitions/UUID" + }, + "source": { + "const": "PlanX", + "default": "PlanX", + "type": "string" + }, + "submittedAt": { + "$ref": "#/definitions/DateTime" + } + }, + "required": [ + "source", + "id", + "createdAt", + "submittedAt" + ], + "type": "object" + } + }, + "required": [ + "service", + "session" + ], + "type": "object" + }, + "Property": { + "$id": "Property", + "additionalProperties": false, + "description": "This is an applicant", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "Proposal": { + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "Responses": { + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "Result": { + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "Schema": { + "$id": "DigitalPlanningDataSchema", + "additionalProperties": false, + "description": "Root of PlanX's Digital Planning Schema", + "properties": { + "data": { + "additionalProperties": false, + "properties": { + "applicant": { + "$ref": "#/definitions/Applicant" + }, + "application": { + "$ref": "#/definitions/Application" + }, + "property": { + "$ref": "#/definitions/Property" + }, + "proposal": { + "$ref": "#/definitions/Proposal" + }, + "user": { + "$ref": "#/definitions/User" + } + }, + "required": [ + "applicant", + "property", + "application", + "proposal", + "user" + ], + "type": "object" + }, + "files": { + "items": { + "$ref": "#/definitions/File" + }, + "type": "array" + }, + "metadata": { + "$ref": "#/definitions/Metadata" + }, + "responses": { + "$ref": "#/definitions/Responses" + }, + "result": { + "$ref": "#/definitions/Result" + } + }, + "required": [ + "data", + "result", + "metadata", + "responses", + "files" + ], + "title": "Digital Planning Data Schema", + "type": "object" + }, + "URL": { + "format": "uri", + "pattern": "^https?://", + "type": "string" + }, + "UUID": { + "format": "uuid", + "type": "string" + }, + "User": { + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + } + } +} \ No newline at end of file