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:
Example:
json
{
"type":"object",
"properties": {
"givenName": { "type": "string"},
"familyName": { "type": "string"}
},
"required":["givenName", "familyName"],
"additionalProperties": false
}
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