REST API (v2)
POST /schemas/:version/validate_resolved
Validate a ResolvedDatachainInstance against its referenced schema.
POST /schemas/:version/validate_resolved
The HTTP status is 200 for both
ok: true and ok: false. Snapshot consistency (snapshot_drift) is checked only when the pinned schema_version is still in the schema index — graceful degradation per R9.Summary
Validate a snapshot-pinned ResolvedDatachainInstance end-to-end:
- Element-id resolution against
schema_snapshot.elements∪suggested_elements(snapshot wins on collision; collision is a hard error). - R14 wire enforcement: non-empty
suggested_elementsrequiresauthoring_provenance.kind === 'ai_generated'. - Existing semantic rules (cardinality, required categories, context refs) operating against the merged element pool.
- Snapshot consistency vs the live store, when the pinned version is still served.
Request
POST https://api.dtpr.io/api/v2/schemas/:version/validate_resolved
Content-Type: application/json
{ /* ResolvedDatachainInstance */ }
Response — valid
HTTP/1.1 200 OK
Content-Type: application/json
{ "ok": true, "warnings": [] }
Response — invalid
HTTP/1.1 200 OK
Content-Type: application/json
{
"ok": false,
"errors": [
{
"code": "element_id_collision",
"message": "id 'foo' present in both schema_snapshot.elements and suggested_elements",
"path": "suggested_elements"
}
]
}
Errors
| Code | HTTP | Meaning |
|---|---|---|
bad_request | 400 | Invalid JSON body or malformed :version. |
not_found | 404 | Version is not registered. |
parse_error | 200 | Resolved-form Zod parse failed. |
element_id_collision | 200 | Same id in schema_snapshot.elements and suggested_elements (R15a). |
provenance_required | 200 | Non-empty suggested_elements without authoring_provenance.kind === 'ai_generated' (R14). |
element_provenance_unknown_element | 200 | A key in authoring_provenance.element_provenance does not match any placement element_id. |
unknown_element_id | 200 | Placement element_id absent from snapshot ∪ suggested (R15 fallthrough miss). |
snapshot_drift | 200 | schema_snapshot content differs from the canonical store; check is skipped when the pinned version is no longer in the index. |
| Semantic validator codes | 200 | Shape-valid but semantically wrong (REQUIRED_CATEGORY_MISSING, etc.). |
Limits
| Limit | Value |
|---|---|
| Rate limit | 15 req / 60 s (RL_RESOLVE binding, shared with resolve). |
| Wall-clock | 5000 ms. |
| CPU | 500 ms (Worker-wide). |
See also
- POST /schemas/:version/resolve — produces the resolved form this endpoint validates.
- MCP
validate_resolved— same validator with the MCP soft-failure envelope. - Datachains — both wire forms, conditional round-trip rule, and the
schema_snapshottrust boundary.