Browse Source

.

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

113
config/forms/schema/generic.json

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

75
config/forms/schema/test.json

@ -21,61 +21,36 @@
"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": { "type": "object",
"description": "", "patternProperties": {
"type": "object", "[a-z_\/#]+": {
"patternProperties": { "description": "",
"^[0-9]+$": { "type": "object",
"description": "", "required": ["label"],
"type": "object", "properties": {
"required": ["label"], "label": {
"properties": { "description": "",
"label": { "type": "string"
"description": "",
"type": "string"
},
"pages": {
"type": "object",
"required": ["header"],
"patternProperties": {
"^[0-9]+$": {
"properties": {
"header": {
"description": "",
"type": "string"
},
"description": {
"description": "",
"type": "string"
},
"questions": {
"type": "object",
"properties": {
}
}
}
}
} }
} },
"minProperties": 1
} }
}, }
"additionalProperties": false,
"maxProperties": 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