From 8517613c64344daca12c4b2674403021abeb98e7 Mon Sep 17 00:00:00 2001 From: magicmilo Date: Wed, 10 Nov 2021 14:20:22 +0000 Subject: [PATCH] . --- config/forms/schema/generic.json | 113 ++++++++++++++--------------- config/forms/schema/test.json | 75 +++++++------------ spec/fixtures/forms/test_form.json | 9 --- 3 files changed, 80 insertions(+), 117 deletions(-) diff --git a/config/forms/schema/generic.json b/config/forms/schema/generic.json index d7e71468d..50c08369c 100644 --- a/config/forms/schema/generic.json +++ b/config/forms/schema/generic.json @@ -19,77 +19,74 @@ "type": "integer" }, "sections": { - "description": "", "type": "object", "patternProperties": { - "^[0-9]+$": { - "description": "", - "type": "string" - }, - "label": { + "[a-z_\/#]+": { "description": "", - "type": "string" + "type": "object" }, - "subsections": { - "description": "", - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "description": "", - "type": "string" - }, - "label": { - "description": "", - "type": "string" - }, - "subsections": { - "description": "", - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "description": "", - "type": "string" - }, - "label": { - "description": "", - "type": "string" - }, - "pages": { - "description": "", - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "description": "", - "type": "string" - } - }, - "questions": { + "properties": { + "label": { + "description": "", + "type": "string" + }, + "subsections": { + "description": "", + "type": "object", + "patternProperties": { + "[a-z_\/#]+": { + "description": "", + "type": "object", + "required": ["label"], + "properties": { + "label": { "description": "", + "type": "string", + "required": "true" + }, + "pages": { "type": "object", + "required": ["header"], "patternProperties": { - "^[0-9]+$": { - "description": "", - "type": "string" - }, - "conditional_for": { - "type": "object", - "properties": "" + "type": "object", + "[a-z_]+": { + "properties": { + "header": { + "description": "", + "type": "string" + }, + "description": { + "description": "", + "type": "string" + }, + "questions": { + "type": "object", + "patternProperties": { + "type": "object", + "[a-z_]+": { + "properties": { + "check_answer_label": { + "type": "string" + } + } + } + }, + "minProperties": 8 + }, + "minProperties": 8 + } } - } - }, - "conditional_route_to": { - "type": "object", - "properties": "" - }, - "default_next_page": { - "type" : "string" + }, + "minProperties": 8 } } } - } + }, + "minProperties": 8 } } - } + }, + "minProperties": 1 } } } \ No newline at end of file diff --git a/config/forms/schema/test.json b/config/forms/schema/test.json index 9058f70c4..90a06942d 100644 --- a/config/forms/schema/test.json +++ b/config/forms/schema/test.json @@ -21,61 +21,36 @@ "sections": { "type": "object", "patternProperties": { - "^[0-9]+$": { + "[a-z_\/#]+": { "description": "", - "type": "string" - }, - "properties": { - "label": { - "description": "", - "type": "string" - }, - "subsections": { - "description": "", - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "description": "", - "type": "object", - "required": ["label"], - "properties": { - "label": { - "description": "", - "type": "string" - }, - "pages": { - "type": "object", - "required": ["header"], - "patternProperties": { - "^[0-9]+$": { - "properties": { - "header": { - "description": "", - "type": "string" - }, - "description": { - "description": "", - "type": "string" - }, - "questions": { - "type": "object", - "properties": { - - } - } - } - } + "type": "object", + "properties": { + "label": { + "description": "", + "type": "string" + }, + "subsections": { + "type": "object", + "patternProperties": { + "[a-z_\/#]+": { + "description": "", + "type": "object", + "required": ["label"], + "properties": { + "label": { + "description": "", + "type": "string" } - } + }, + "minProperties": 1 } - }, - "additionalProperties": false, - "maxProperties": 1, - "minProperties": 1 + } } - } + }, + "minProperties": 2 } - } + }, + "minProperties": 1 } } } \ No newline at end of file diff --git a/spec/fixtures/forms/test_form.json b/spec/fixtures/forms/test_form.json index 73df96635..b5467a48f 100644 --- a/spec/fixtures/forms/test_form.json +++ b/spec/fixtures/forms/test_form.json @@ -9,15 +9,6 @@ "household_characteristics": { "label": "Household characteristics", "pages": { - "tenant_code": { - "questions": { - "tenant_code": { - "check_answer_label": "Tenant code", - "header": "What is the tenant code?", - "type": "text" - } - } - } } } }