Validate JSON field constraints
trust_validate_dataValidate JSON field presence, exact types, primitive enums and inclusive numeric bounds, returning ALLOW/BLOCK, field reasons and checked_fields. Combine required:true, type:"integer" and min:1 for a positive mandatory quantity: min alone neither requires a value nor rejects numeric strings. Missing, null or empty optional values skip the other constraints; 0 and false do not. For nested data, fields["order.total"] addresses a leaf; allow_extra:false compares top-level keys, so keep it true for dot-path rules. Use trust_clean_data for transformations or trust_check_action for evidence/spending checks. This validates structure, not facts or provenance. Free, unauthenticated, stateless pilot: rules apply only to this call. Usage metadata is recorded; request bodies are not stored.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | JSON object to inspect; do not submit secrets or personal data. | |
| fields | Yes | Map of dot-separated field paths to constraints, e.g. {"order.total":{"type":"number","min":0,"required":true}}. Inline rules apply only to this request. | |
| allow_extra | No | False rejects top-level keys absent from fields. With nested dot paths use true; this flag is not a recursive additional-properties check. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | The operation completed; does not imply the verdict is ALLOW. | |
| reasons | Yes | All failed checks; empty when ALLOW. | |
| service | Yes | Service that evaluated the request. | |
| verdict | Yes | Advisory verdict. The integrator must prevent execution on BLOCK or any error. | |
| version | Yes | Deployed implementation version. | |
| checked_fields | Yes | Number of field rules evaluated. |