Skip to main content

Module lifecycle

Module lifecycle 

Source
Expand description

Lifecycle endpoint request validation (ACDP 0.3, RFC-ACDP-0013 §6 step 2) — the envelope layer for POST /contexts/{ctx_id}/retract and POST /contexts/{ctx_id}/republish.

The request body is a CLOSED JSON object with exactly one member, event. A request that attempts to supply or alter body content through a lifecycle endpoint — a body member, or any envelope member named after a body field — MUST be rejected with the immutable_field wire code (HTTP 400), activated in 0.3.0 from the reservation held since v0.1.0 (RFC-ACDP-0007 §5, RFC-ACDP-0009 §2.1): bodies are immutable, and lifecycle endpoints mutate registry state only. The distinct code exists so producers learn the category error, not a generic validation failure (fixture lc-002). Any other unknown envelope member is a plain schema_violation against the closed request shape.

Functions§

parse_lifecycle_request
Validate a raw lifecycle request body against the closed {"event": {…}} envelope (RFC-ACDP-0013 §6 step 2) and parse the event through the closed §4 schema.