-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontent-type-schema-grammar.txt
50 lines (49 loc) · 1.95 KB
/
content-type-schema-grammar.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#### Type Schema Grammar:
* **Schema**: [ **Entry** ]
* **Entry**: { **Key**, **Type**, { **Options** } }
* **Key**: string
* **Type**:
"label" |
"string" |
"text" |
"integer" |
"number" |
"json" |
"boolean" |
"choice" |
"list" |
"object" |
"file" |
"attachedFile"
* **Options** - Each type may have additional options that can modify contents, display properties, or validation of the field
- \*
- label: string
- The label for this field. If not set, the key will be used as the label
- required: boolean
- Whether or not this field is required. Validation will be performed on the form
using the html5 "required" attribute
- "label":
- text: string
- The text to be displayed in the label
- "object":
- fields: **Schema**
- The fields of an object are described as a schema
- flattenDisplay: boolean
- If true, the fields will not be wrapped in a subsection in the form with the object label -- the fields will appear as if they were not contained in an object.
- "choice":
- options: [ [label, value], ...]
- List of options to choose from. Each entry is a pair consisting of the label of the entry and its value
- "file":
- multiple: boolean
- If specified, will allow uploading of multiple files. Otherwise, only a single file will
be allowed
- accept: mime-type-string | [ mime-type-string ]
- Limits the allowed filetypes to be upload to the specified mime-types
- preview: boolean
- If specified, a preview of the selected image will be shown above the selection when an image is chosen
- "accept" should be an image type. If multiple inputs are allowed, only the first selection will be shown
- "attachedFile":
- hash: string
- The hash of the content type part corresponding to the attached file
- filename: string
- The filename to use when the file is downloaded. If not provided, the label or the key will be used.