Browse Source

.

pull/76/head
magicmilo 3 years ago
parent
commit
ebc79e4982
  1. 4
      app/helpers/json_schema_validation.rb
  2. 6
      config/forms/schema/generic.json
  3. 15
      spec/fixtures/forms/test_validator.json

4
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)

6
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": "",

15
spec/fixtures/forms/test_validator.json vendored

@ -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
}
}
}
}
}

Loading…
Cancel
Save