Taxonomy
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.elementssuggested_elements (snapshot wins on collision; collision is a hard error).
  • R14 wire enforcement: non-empty suggested_elements requires authoring_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

CodeHTTPMeaning
bad_request400Invalid JSON body or malformed :version.
not_found404Version is not registered.
parse_error200Resolved-form Zod parse failed.
element_id_collision200Same id in schema_snapshot.elements and suggested_elements (R15a).
provenance_required200Non-empty suggested_elements without authoring_provenance.kind === 'ai_generated' (R14).
element_provenance_unknown_element200A key in authoring_provenance.element_provenance does not match any placement element_id.
unknown_element_id200Placement element_id absent from snapshot ∪ suggested (R15 fallthrough miss).
snapshot_drift200schema_snapshot content differs from the canonical store; check is skipped when the pinned version is no longer in the index.
Semantic validator codes200Shape-valid but semantically wrong (REQUIRED_CATEGORY_MISSING, etc.).

Limits

LimitValue
Rate limit15 req / 60 s (RL_RESOLVE binding, shared with resolve).
Wall-clock5000 ms.
CPU500 ms (Worker-wide).

See also