Validate Mapping
AI-generatedSummary
Validate a JSONata mapping configuration against source and target JSON documents and optionally their JSON Schemas to ensure the mapping's correctness and compliance.
Inputs
- Source Document Mode (required) — Choose whether to use the incoming item JSON or a pasted source JSON document as the source data for validation.
- Source Field — When using incoming item JSON, specify the field path containing the source JSON; 'json' uses the entire item JSON.
- Source JSON Document — A static source JSON document to use instead of incoming item JSON, for design-time validation.
- Use Source JSON Schema — Enable to provide a JSON Schema describing the source document for source validation and AI context.
- Source JSON Schema — The JSON Schema describing the source document. Must be a valid, meaningful schema if enabled.
- Use Target JSON Schema — Enable to provide a JSON Schema describing the target document for output validation and AI context.
- Target JSON Schema — The JSON Schema describing the expected target document. Must be valid if enabled.
- Target Sample JSON (required) — A sample JSON example of the target structure, used if no target schema is provided and for AI context.
- Mapping Config (required) — The JSONata mapping configuration JSON, consisting of mapping rules with target paths and JSONata expressions to validate.
- Validate Source With Schema — Whether to validate the source JSON against the source schema if supplied.
- Validate Output With Target Schema — Whether to validate the transformed output JSON against the target schema if supplied.
- Return Debug Info — Whether to return detailed debug information about the validation process.
Output shape
a JSON object per input item containing validation results
The output JSON includes keys indicating overall validity, lists of errors and warnings found in the mapping config, optionally source and output schema validation results, and a boolean 'valid' field that combines all checks. Validation covers structure of the mapping config, correctness of JSONata expressions, presence of mapped target paths, and compliance with source and target JSON Schemas if enabled.
Examples
Example 1: Validating a mapping config using pasted source JSON and target sample JSON, with source and target JSON Schemas attached, returning errors and warnings if any.
Specify sourceDocumentMode as 'pastedJson' with a sourceJsonDocument, provide mappingConfig JSON array with mapping rules, enable useSourceSchema and useTargetSchema and supply respective JSON Schemas, and ensure validateSourceWithSchema and validateOutputWithSchema are true to enforce schema validations.