code | type | title |
---|---|---|
true |
page |
validate |
Validates data against existing validation rules.
Documents are always valid if no validation rules are defined on the provided index and collection.
This request does not store the document.
URL: http://kuzzle:7512/<index>/<collection>/_validate
Method: POST
Body:
{
// Document content to check
}
{
"index": "<index>",
"collection": "<collection>",
"controller": "document",
"action": "validate",
"body": {
// document content to check
}
}
collection
: collection nameindex
: index name
Document content to validate.
Returns the document validation status, with the following properties:
errorMessages
: the exhaustive list of violated validation rules. Present only ifvalid
is falsevalid
: a boolean telling whether the provided pass all validation rules
{
"status": 200,
"error": null,
"index": "<index>",
"collection": "<collection>",
"controller": "document",
"action": "validate",
"result": {
"valid": true
}
}