Enable payload validation for transformed JSON documents in Mappings API

Stedi Mappings let you transform JSON documents from one structure to another. By default, the Mappings API does not apply any payload validation on the /map endpoint.Now, you can enable Strict validation mode to validate the input and the output payload of the mapping operation. Validation helps you ensure that the mapping results are accurate and catch deviations from expected results early.To apply strict validation

, set the validation_mode query parameter to strict. Mappings uses the source schema

 to validate the input document and the target schema

 to validate the outgoing document.If validation of the input or output payload fails, the response is a 400 error with the validation_failed code and validation_errors object.

HTTP/1.1 400 Content-Type: application/json { "code": "validation_failed", "message": "The input of the mapping does not conform to the specified source JSON Schema, and the output of the mapping does not conform to the specified target JSON Schema.", "validation_errors": { "source": { "mapping_input": { "quantity": 15, "unit_price": 2.50 }, "errors": [ { "code": "required", "message": "must have required property 'unit_description'", "json_pointer": "/", "json_schema_pointer": "#/required" } ] }, "target": { "mapping_output": { "total": 37.50 }, "errors": [ { "code": "type", "message": "must be integer", "json_pointer": "/total", "json_schema_pointer": "#/properties/total/type" } ] } } }

PreviousAdd a description to validated samples in Stedi guides

Get started with Stedi

Start free with a sandbox account. Upgrade to production when you’re ready. There are no monthly minimums or setup fees. You only pay for the transactions you use. See our pricing.

Sign up free