Requirements
- The source file must be JSON or XML format.
- The validation schema file must be stored in MinIO in the
{environment}-configbucket undervalidation-schema/{filename}.
Configuration
Set thevalidationSchema field in the dataQuality block to the filename of the schema. The pipeline resolves the file from the MinIO config bucket at {environment}-config/validation-schema/{filename}. A full s3://bucket/key URL is also accepted and used as-is.
Example Schema
Validation uses the Everitorg.everit.json.schema library (1.5.1), which implements JSON Schema Draft 4 only. The $schema URI is ignored, and Draft 07-only keywords (const, if/then/else, propertyNames, numeric exclusiveMinimum/exclusiveMaximum as values) are silently ignored rather than enforced. Write schemas to the Draft 4 specification.
A JSON Schema file stored in MinIO at {environment}-config/validation-schema/product_catalog_schema.json:
Behavior
- The pipeline loads the schema file from the configured path in the environment’s config bucket.
- The whole file is validated as a single document against the schema. A JSON file containing an array of records therefore needs a schema with
"type": "array"anditemsdescribing each record; the example above validates a file that holds a single object. - If any record fails validation, the file is rejected and processing stops.
- Validation errors are logged with details about which fields failed and why.
