Browse Source

.

pull/76/head
magicmilo 3 years ago
parent
commit
8517613c64
  1. 61
      config/forms/schema/generic.json
  2. 39
      config/forms/schema/test.json
  3. 9
      spec/fixtures/forms/test_form.json

61
config/forms/schema/generic.json

@ -19,13 +19,13 @@
"type": "integer" "type": "integer"
}, },
"sections": { "sections": {
"description": "",
"type": "object", "type": "object",
"patternProperties": { "patternProperties": {
"^[0-9]+$": { "[a-z_\/#]+": {
"description": "", "description": "",
"type": "string" "type": "object"
}, },
"properties": {
"label": { "label": {
"description": "", "description": "",
"type": "string" "type": "string"
@ -34,62 +34,59 @@
"description": "", "description": "",
"type": "object", "type": "object",
"patternProperties": { "patternProperties": {
"^[0-9]+$": { "[a-z_\/#]+": {
"description": "", "description": "",
"type": "string" "type": "object",
}, "required": ["label"],
"properties": {
"label": { "label": {
"description": "", "description": "",
"type": "string" "type": "string",
"required": "true"
}, },
"subsections": { "pages": {
"description": "",
"type": "object", "type": "object",
"required": ["header"],
"patternProperties": { "patternProperties": {
"^[0-9]+$": { "type": "object",
"[a-z_]+": {
"properties": {
"header": {
"description": "", "description": "",
"type": "string" "type": "string"
}, },
"label": { "description": {
"description": "", "description": "",
"type": "string" "type": "string"
}, },
"pages": {
"description": "",
"type": "object",
"patternProperties": {
"^[0-9]+$": {
"description": "",
"type": "string"
}
},
"questions": { "questions": {
"description": "",
"type": "object", "type": "object",
"patternProperties": { "patternProperties": {
"^[0-9]+$": {
"description": "",
"type": "string"
},
"conditional_for": {
"type": "object", "type": "object",
"properties": "" "[a-z_]+": {
"properties": {
"check_answer_label": {
"type": "string"
}
} }
} }
}, },
"conditional_route_to": { "minProperties": 8
"type": "object",
"properties": ""
}, },
"default_next_page": { "minProperties": 8
"type" : "string"
} }
} }
},
"minProperties": 8
} }
} }
} }
},
"minProperties": 8
} }
} }
},
"minProperties": 1
} }
} }
} }

39
config/forms/schema/test.json

@ -21,20 +21,18 @@
"sections": { "sections": {
"type": "object", "type": "object",
"patternProperties": { "patternProperties": {
"^[0-9]+$": { "[a-z_\/#]+": {
"description": "", "description": "",
"type": "string" "type": "object",
},
"properties": { "properties": {
"label": { "label": {
"description": "", "description": "",
"type": "string" "type": "string"
}, },
"subsections": { "subsections": {
"description": "",
"type": "object", "type": "object",
"patternProperties": { "patternProperties": {
"^[0-9]+$": { "[a-z_\/#]+": {
"description": "", "description": "",
"type": "object", "type": "object",
"required": ["label"], "required": ["label"],
@ -42,40 +40,17 @@
"label": { "label": {
"description": "", "description": "",
"type": "string" "type": "string"
},
"pages": {
"type": "object",
"required": ["header"],
"patternProperties": {
"^[0-9]+$": {
"properties": {
"header": {
"description": "",
"type": "string"
},
"description": {
"description": "",
"type": "string"
},
"questions": {
"type": "object",
"properties": {
}
}
}
}
}
}
} }
}, },
"additionalProperties": false,
"maxProperties": 1,
"minProperties": 1 "minProperties": 1
} }
} }
} }
},
"minProperties": 2
} }
},
"minProperties": 1
} }
} }
} }

9
spec/fixtures/forms/test_form.json vendored

@ -9,15 +9,6 @@
"household_characteristics": { "household_characteristics": {
"label": "Household characteristics", "label": "Household characteristics",
"pages": { "pages": {
"tenant_code": {
"questions": {
"tenant_code": {
"check_answer_label": "Tenant code",
"header": "What is the tenant code?",
"type": "text"
}
}
}
} }
} }
} }

Loading…
Cancel
Save