validateLast updated on
Last updated on
Validate an Paradoc artifact against the schema and logic rules
Validates an Paradoc artifact (form, document, bundle, or checklist) against the Paradoc schema and optionally checks logic expressions.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
artifact | object | Yes | The Paradoc artifact object to validate |
options.schema | boolean | No | Validate schema structure (default: true) |
options.logic | boolean | No | Validate logic expressions (default: true) |
Response
| Field | Type | Description |
|---|---|---|
valid | boolean | Whether the artifact passed validation |
detectedKind | string | Detected artifact kind: form, document, bundle, or checklist |
issues | array | List of validation issues, each with message and optional path |
error | string | Error message if validation could not be performed (returned instead of detectedKind and issues) |
Example
// Request
{
"artifact": {
"kind": "form",
"title": "My Form",
"schema": "2026-01-01",
"fields": []
}
}
// Response
{
"valid": true,
"detectedKind": "form"
}When validation fails, the response includes the list of issues:
{
"valid": false,
"detectedKind": "form",
"issues": [
{
"message": "Required property 'title' is missing",
"path": ["title"]
}
]
}Disabling checks
You can disable schema or logic validation independently using the options parameter:
{
"artifact": { "kind": "form", "..." : "..." },
"options": {
"schema": true,
"logic": false
}
}This is useful when you want to validate only the structure without checking logic expressions, or vice versa.
Logic checking
When options.logic is on, every visible / required / def / rule expression is run through the typed @paradoc/expr checker. Each issue names the offending expression and its path in the artifact, and the checker catches:
- unknown references (for example
fields.hasVehicle.value— fields are addressed asfields.<id>, with no.value) and unknown functions - type mismatches (comparing a string field to a number)
- gates that don't evaluate to a boolean
Because the checker shares its type system with runtime evaluation, an expression that passes here will not fail differently when the form is filled.