diff --git a/app/helpers/json_schema_validation.rb b/app/helpers/json_schema_validation.rb index 329186831..5435f02e6 100644 --- a/app/helpers/json_schema_validation.rb +++ b/app/helpers/json_schema_validation.rb @@ -36,8 +36,8 @@ end begin - # path = "config/forms/schema/generic.json" - path = "config/forms/schema/2021_2022.json" + path = "config/forms/schema/generic.json" + # path = "config/forms/schema/2021_2022.json" file = File.open(path) schema = JSON.parse(file.read) diff --git a/config/forms/schema/generic.json b/config/forms/schema/generic.json index a52897c43..024990b8b 100644 --- a/config/forms/schema/generic.json +++ b/config/forms/schema/generic.json @@ -11,11 +11,13 @@ }, "start_year": { "description": "", - "type": "integer" + "type": "integer", + "optional": "true" }, "end_year": { "description": "", - "type": "integer" + "type": "integer", + "required": "false" }, "sections": { "description": "", diff --git a/spec/fixtures/forms/test_validator.json b/spec/fixtures/forms/test_validator.json index 13aed9e5f..e0fe13361 100644 --- a/spec/fixtures/forms/test_validator.json +++ b/spec/fixtures/forms/test_validator.json @@ -19,6 +19,21 @@ } } } + }, + "person_1_age": { + "header": "", + "description": "", + "questions": { + "person_1_age": { + "check_answer_label": "Tenant's age", + "header": "What is the tenant's age?", + "hint_text": "", + "type": "numeric", + "min": 0, + "max": 120, + "step": 1 + } + } } } }