Form Schema
The form schema is defined by a JSON schema. It can be defined by setting the dataFeedSchema
attribute
of a form.
JSON Data Schema
The schema for the JSON data, i.e. the dataFeedElement
of a submission, is fully covered by a standard JSON schema with
a few custom extensions:
Example:
json
{
"type":"object",
"properties": {
"givenName": {
"type": "string",
"localizedName": {
"de": "Vorname",
"en": "Given name"
},
"tableViewVisibleDefault": false
},
"familyName": {
"type": "string",
"localizedName": {
"de": "Nachname",
"en": "Family name"
},
"tableViewVisibleDefault": true
}
},
"required":["givenName", "familyName"],
"additionalProperties": false
}
Extensions:
- localizedName
: a JSON object that consists of key-value pairs, where the keys are language codes,
and the values are the translated names of this property
- tableViewVisibleDefault
: a JSON bool that indicates whether the column representing this property should be
visible in the submissions table view by default
File Data Schema
The file data schema is defined by a custom files
section in the JSON schema of the form, which defines a
mapping between file property names and their schema:
json
{
"files": {
"birthCertificate": {
"allowedMimeTypes": [ "application/pdf", "image/jpeg" ],
"maxSizeMb": 10
},
"photos": {
"minNumber": 0,
"maxNumber": 10,
"allowedMimeTypes": [ "image/png", "image/jpeg" ],
"maxSizeMb": 10
}
},
"additionalFiles": false
}
maxSizeMb
The maximum file size in megabytes. Default: 10minNumber
The minimum number of files with for this file property, 0 meaning it's optional. Default: 1maxNumber
The minimum number of files with for this file property. Default: 1allowedMimeTypes
The list of allowed mimetypes for this file property. Default: [] (None)additionalFiles
If set totrue
, additional file properties, which are not defined in thefiles
section are allowed. Default:false
Input Validation
Submissions are always validated against a JSON schema. If a submission does not comply to the form schema, a Bad Request 400 error status is returned.
If the form schema is not set when a submission is posted, the schema is autogenerated based on the submission data. Subsequent submissions will be validated against that schema.
Output Validation
Output validation is available for the get submissions endpoint,
and can be requested by specifying the outputValidation
query parameter:
- KEYS
Means that only those data values are returned, whose keys are defined in the form schema