112399a67ebb
Validate From Schema
Requires enable-data-models-feature feature flag. Validate data against a json schema, either by schema definition or schema ID. jsonSchema or schemaId are required parameters.
Authorization Required:
- Authenticated
Query parameters
If false, ignore required fields of a schema and validate the format only
Request body
Response
Successful
An object with a key of data, with a value that is an object. That object has keys that are the fieldMapping field with the matching data property as the value. If no fieldMapping is passed, then the passed data is returned if no errors are encountered. e.g. Given the data below plus the fieldMapping example -
data: { name1: 'shirt', price1: 1, addProp: 'extra' }
jsonSchema: { title: 'Sample Schema', type: 'object', properties: { name: { type: 'string' }, price: { type: 'number' } }, required: ['name'] }
Response:
{ data: { 'modelId': { name: 'shirt', price: 1 } } }