Validation
Each entity stored in the System was validated against the Datamodel before it was created or updated.
This validation ensures that the data adheres to the defined structure and types, preventing malformed data from being stored in the System.
The entity is validated against the types defined in the entity schema.
The validation process checks if the data matches the expected types and structure, ensuring that all required fields are present and correctly formatted.
If the data does not conform to the expected types, the System will return a validation protocol that details the issues found during validation.
Validation Protocol
The validation protocol provides insight into the entity validation process of the Gateway. It informs you about possible malformed fields and the reasons for validation failure.
The validation protocol is part of the response when creating or updating an entity.
Here is an example validation protocol:
{
"project": {
"level": "error",
"error": "missing_value",
"description": "The field 'project' is required and can't be empty. Please provide a value!"
},
"content": {
"schema:name": {
"level": "error",
"error": "invalid_value",
"description": "The given data doesn't match the MultiLang structure, example: [{'lang': 'de-DE', 'value': 'Name DE'}]"
}
}
}
The protocol is an object where the keys represent the paths to the fields that failed validation. The path can theoretically be infinite.
Each field contains an object with the following properties:
level: The severity of the error. Can beerror,warning,info, orverbose.error: The type of error.missing_value: The value is required and can't be empty.readonly: The field is read-only and can't be changed.locked: The field is locked and can't be changed.too_long: The value is too long.internal_error: An internal error occurred.unknown_field: The field doesn't exist in the schema.doesnt_exist: An entity for this value doesn't exist.no_data: No value was provided.required_field: The field is required.invalid_type: The type, according to the data model specification, is invalid.invalid_value: The value, according to the data model specification, is invalid.forbidden: You are not allowed to change this field.description: A human-readable description of the error.