--- title: "Validation, schemas, and repair" slug: "build-ai-ready-systems-validate-test-validation-schemas-repair" description: "Validate configs, repair drift, and run test ladder. Step-by-step for integrators — prerequisites, validate commands, and links to concept pages." tags: ["Integration", "Developer", "Integrator"] updated: 2026-11-30T18:58:53Z published: 2026-11-17T07:08:17Z canonical: "docs.aifabrix.ai/build-ai-ready-systems-validate-test-validation-schemas-repair" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.aifabrix.ai/llms.txt > Use this file to discover all available pages before exploring further. # Validation, schemas, and repair **Validation** proves integration configs match JSON schemas and behave correctly before upload. **Repair** fixes drift between `application.yaml` and on-disk JSON — the most common cause of “validate passed locally but upload failed” incidents. ## Why it matters Uncertified or invalid configs must not reach AI workloads. Validation is the gate before upload, test, and certification. Skipping repair after manual edits leaves silent drift: missing datasource entries, wrong `systemKey`, stale deploy JSON, or dimensions out of sync with attributes. Treat **validate → repair (dry-run) → test ladder** as the default loop for every integration change. Run validate at the end of each phase (model, govern, publish) — not only once after initial scaffold. ## Prerequisites - Integration folder under `integration/<systemKey>/` - `aifabrix auth status` green for online cert-sync (optional) ## Where it lives | Artifact | Schema | Typical file | | --- | --- | --- | | Application manifest | `application-schema` ~1.4.x | `application.yaml` | | External system | `external-system-schema` ~1.8.x | `<systemKey>-system.json` | | External datasource | `external-datasource-schema` ~2.7.x | `<datasourceKey>.json` | Reference summaries: [External system schema](/docs/reference-external-system-schema), [External datasource schema](/docs/reference-external-datasource-schema), [Application schema](/docs/reference-application-schema). ## How to set 1. **Validate one file or the whole integration**: ``` aifabrix validate aifabrix validate aifabrix datasource validate ``` 1. **Preview repair** before mutating lists or auth: ``` aifabrix repair --dry-run ``` 1. **Apply repair flags** as needed: ``` aifabrix repair --rbac --expose --sync aifabrix repair --auth apikey aifabrix json ``` 1. **Re-validate** — never upload on stale repair output. 2. **Optional cert sync** when online certification state changed: ``` aifabrix validate --cert-sync ``` 1. **Test ladder** after green validate — see [Test ladder and protection](/docs/build-ai-ready-systems-validate-test-test-ladder-protection). ## Defaults and examples | Drift symptom | Repair action | | --- | --- | | Datasource file exists but not in application.yaml | Sync system/datasource lists | | Datasource `systemKey` mismatch | Align keys | | OpenAPI assumed OAuth on API-key vendor | `--auth apikey` + env.template | | metadataSchema stale vs attributes | Refresh from fieldMappings | | Missing deploy JSON | Regenerate via `json` | Datasource root fields validated on every pass include **`key`**, **`displayName`**, **`systemKey`**, **`entityType`**, **`resourceType`**, **`primaryKey`**, and indexed **`externalId`** for record/document storage. Example validate command sequence: ``` { "command": "aifabrix validate example-crm", "expects": ["schema", "resourceType", "externalId"] } ``` ``` aifabrix validate example-crm aifabrix repair example-crm --dry-run aifabrix repair example-crm --expose --rbac aifabrix validate example-crm aifabrix upload example-crm --probe ``` Progress from local to live behavior: ``` aifabrix test aifabrix test-integration aifabrix test-e2e aifabrix datasource test-e2e --app --verbose ``` `verify-operations` orchestrates validate → test → integration → E2E as **certification pillar 1**. Do not run certification pillars on broken validate output. ## Validate ``` aifabrix validate aifabrix repair --dry-run ``` If validate reports unknown **`resourceType`**, fix catalog first — repair cannot invent catalog keys. ## Common mistakes | Mistake | Impact | Fix | | --- | --- | --- | | Edit JSON without updating application.yaml | Validate fails or upload targets wrong files | `repair --dry-run` | | Skip E2E after schema-only validate | Ops pillar fails on live API | Full test ladder | | Manual deploy JSON edits | Overwritten on next `json` | Regenerate, don't hand-edit | | Validate once at scaffold time | Drift accumulates through govern/publish | Validate every phase | ## Limits Schema version numbers drift with Builder releases — confirm against [reference schemas](/docs/reference) when validate errors cite unexpected required fields. Repair is idempotent for lists and auth but does not replace thoughtful field mapping edits. Keep a change log of which **`datasourceKey`** files were touched each sprint so repair dry-runs stay reviewable. When validate cites missing **`externalId`**, fix metadataSchema before re-running repair — repair will not invent join identity fields for you. ## Related - [CLI workflow reference](/build-ai-ready-systems-validate-test-cli-workflow.md)