-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathjson-schema-form.schema.json
188 lines (188 loc) · 6.37 KB
/
json-schema-form.schema.json
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "JSON json-schema-form-Schema",
"definitions": {
"schemaArray": {
"allOf": [
{
"$ref": "http://json-schema.org/draft-07/schema#/definitions/schemaArray"
},
{
"items": { "$ref": "#" }
}
]
}
},
"allOf": [{ "$ref": "http://json-schema.org/draft-07/schema#" }],
"properties": {
"additionalItems": { "$ref": "#" },
"additionalProperties": { "$ref": "#" },
"dependencies": {
"additionalProperties": {
"anyOf": [{ "$ref": "#" }, { "type": "array" }]
}
},
"items": {
"anyOf": [{ "$ref": "#" }, { "$ref": "#/definitions/schemaArray" }]
},
"definitions": {
"additionalProperties": { "$ref": "#" }
},
"patternProperties": {
"additionalProperties": { "$ref": "#" }
},
"properties": {
"additionalProperties": { "$ref": "#" }
},
"if": { "$ref": "#" },
"then": { "$ref": "#" },
"else": { "$ref": "#" },
"allOf": { "$ref": "#/definitions/schemaArray" },
"anyOf": { "$ref": "#/definitions/schemaArray" },
"oneOf": { "$ref": "#/definitions/schemaArray" },
"not": { "$ref": "#" },
"contains": { "$ref": "#" },
"propertyNames": { "$ref": "#" },
"x-jsf-order": {
"description": "This keyword defines the order of fields for a given form or fieldset. It's placed at the schema root and inside of each fieldset.",
"$ref": "http://json-schema.org/draft-07/schema#/definitions/stringArray"
},
"x-jsf-errorMessage": {
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"type": "string",
"description": "Message shown when the value is not of the correct type."
},
"required": {
"type": "string",
"description": "Message shown when the value is required and not provided."
},
"minimum": {
"type": "string",
"description": "Message shown when the value is less than the minimum value."
},
"minLength": {
"type": "string",
"description": "Message shown when the value is less than the minimum length."
},
"maximum": {
"type": "string",
"description": "Message shown when the value is greater than the maximum value."
},
"maxLength": {
"type": "string",
"description": "Message shown when the value is greater than the maximum length."
},
"pattern": {
"type": "string",
"description": "Message shown when the value is not the correct format and does not match the pattern property."
},
"maxFileSize": {
"type": "string",
"description": "Message shown when the file size is greater than the maximum file size."
},
"accept": {
"type": "string",
"description": "Message shown when the file type is not accepted."
}
}
},
"x-jsf-presentation": {
"type": "object",
"description": "Presentation overrides for the schema",
"properties": {
"inputType": {
"description": "Input type for the generated UI field",
"type": "string",
"anyOf": [
{
"const": "text",
"description": "Similar to the native HTML input with text type."
},
{
"const": "select",
"description": "Similar to the native HTML select element."
},
{
"const": "radio",
"description": "Similar to a native HTML input with radio type."
},
{
"const": "number",
"description": "Similar to the native HTML input with number type."
},
{
"const": "date",
"description": "Expects a value with format YYY-MM-DD."
},
{
"const": "checkbox",
"description": "Similar to the native HTML input with checkbox type."
},
{
"const": "email",
"description": "Similar to the native HTML input with email type."
},
{
"const": "file",
"description": "Similar to the native HTML input with file type."
},
{
"const": "fieldset",
"description": "Groups multiple Fields inside. Its expected value is a nested object."
},
{
"const": "group-array",
"description": "A list of inputs that can be repeated. Its expected value is an array."
},
{
"type": "string",
"description": "Any arbitrary custom inputType you might want to represent your UI Field."
}
]
},
"accept": {
"description": "For `inputType: \"file\"`. The accepted file types, as a comma separated string.",
"type": "string"
},
"description": {
"description": "Field description with HTML. If you don't need HTML, please use the native description keyword.",
"type": "string"
},
"statement": {
"description": "Special message about the field. Useful in cases where this message is based on the field value.",
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"description": "The sentence itself. Might include HTML.",
"type": "string"
},
"severity": {
"description": "Defines the type of message.",
"anyOf": [
{ "type": "string", "const": "info" },
{ "type": "string", "const": "warning" },
{ "type": "string", "const": "error" },
{ "type": "string", "const": "success" },
{}
]
}
}
},
"maxFileSize": {
"description": "For `inputType: \"file\"`. The maximum file size in KB. It's used to enhanced Yup validation.",
"type": "number"
},
"addFieldText": {
"description": "Used in `group-array` fields. The button text to add a new field.",
"type": "string"
}
}
}
}
}