Form Template Element - Section¶
Functional Behavior¶
Sections have no functional behavior beyond providing structure to the underlying data collected by the form.
The ONLY Element that can appear in the root of a Form is a section.
Visual Representation¶
Sections represent logical breaks in the form structure.
A Section may have whatever visual representation that is required. Nominally however, a section that is in the root of the document is known as a ***Document Segment**. Whereas a section that is embedded within another section is a Document Section or Sub-Section.
There is no limit to how many levels sub-sections are nested, however the application is not required to show them any differently from one another.
The visual display of sections has no impact on how it is represented in the data captured.
Parent Elements¶
The Section form element, can appear as a child of:
- The Root Object of the JSON Schema
- Section
- Section Optional
Definition¶
Definition: Section
Parameters¶
The Section form element takes the following parameters:
Section | |
Parameters | |
description The displayable description attached to the section. Markdown formatted contents. |
|
---|---|
Required | optional |
Type | string |
Content Media Type | text/markdown; template=handlebars |
properties The sub fields of the section. |
|
Required | yes |
Type | string |
required Which fields MUST appear in the segment. |
|
Required | optional |
Type | string |
title The title of the section. |
|
Required | yes |
Type | string |
Content Media Type | text/plain |
x-flatten If present, and true, then form element is to be flattened into its parent. Typically this parameter is only present in sections. The UI is free to decide how it presents flattened sections. |
|
Required | optional |
Type | boolean |
Example | x-flatten: false |
x-icon The name of the Icon to display with the field. |
|
Required | optional |
Type | string |
Choices | Icons |
Example | x-icon: "bookmark" |
x-order The ordering of the properties to be enforced when displayed. Any field not listed here will get displayed in an alphabetical order following the listed fields. |
|
Required | yes |
Type | string |
Example Usage¶
This is an Example Form Template showing just the Section form element, and its parents.
Example:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "section Example",
"description": "An example of the section Element, and it's parents.",
"$defs": {
"section": {
"additionalProperties": false,
"type": "object"
},
"sectionOptional": {
"additionalProperties": false,
"type": [
"object",
"null"
]
}
},
"type": "object",
"properties": {
"exampleSection": {
"$ref": "#/$defs/section",
"properties": {
"exampleSection": {
"$ref": "#/$defs/section",
"properties": {
"exampleSectionOptional": {
"$ref": "#/$defs/sectionOptional",
"x-final-optional": true,
"x-flatten": false,
"x-icon": "bookmark"
}
},
"x-flatten": false,
"x-icon": "bookmark"
},
"exampleSectionOptional": {
"$ref": "#/$defs/sectionOptional",
"x-final-optional": true,
"x-flatten": false,
"x-icon": "bookmark"
}
},
"x-flatten": false,
"x-icon": "bookmark"
},
"exampleSectionOptional": {
"$ref": "#/$defs/sectionOptional",
"x-final-optional": true,
"x-flatten": false,
"x-icon": "bookmark"
}
},
"additionalProperties": false
}