Skip to content

Event schemas are documentation, not enforced at ingest

Accepted.

approx. 2026-05 (the ingest handler has never validated payloads against schemas; the rule was written down in the published messaging notes dated 2026-08-21).

An event type in FlowCatalyst can carry schema versions: a version string, a schema and a schema type (JSON_SCHEMA, XSD or PROTO), moving through the states FINALISING, CURRENT and DEPRECATED. It is natural to ask whether the platform should check every incoming event’s data against the registered schema and refuse a mismatch.

Several facts argue against it:

  • The event is already a fact. It describes something committed in the producer’s database (see ADR 0012). Refusing it at ingest does not undo that change. It only stops the producer’s outbox, and with block-on-error relaying, every later event in the same message group behind it.
  • Ingest is on the hot path. The ingest endpoints must stay cheap at high event rates. A registry lookup and a schema validation on every item (different schema languages per type) adds cost and a failure mode to the write path.
  • Schemas drift. Producers and registered schemas are updated at different times. A strict gate turns every skew into an outage of the pipeline.
  • The schema’s reader is the consumer. Its value is to tell a subscriber what the payload contains and how it changes between versions.

Event schemas are documentation. Ingest does not enforce them.

At ingest the platform checks:

  • the caller’s permission;
  • that the required fields (type, source, data) are present;
  • that an application-scoped credential publishes only types belonging to its own application (the type’s first segment is the application code);
  • that the caller may write for the named client.

It does not look up the event type and does not validate data against a schema. An event of an unregistered type is stored like any other. It reaches a subscription only if one of the subscription’s event-type patterns matches the type’s text, so in practice an unregistered type is kept as a fact and matches nothing.

In a batch, a problem with one item is reported in that item’s result and the rest are stored.

Schema versions still have a lifecycle (an event type is archived only when every version is deprecated, and deleted only when it is archived or none of its versions was ever published) and are surfaced in the console and the API, for consumers and for code generation.

Consumers own validation. A consumer should check the fields it relies on, and reject or park a payload it cannot use, instead of assuming the platform has done so.

Good

  • The write path stays simple and fast, and ingest does not depend on the registry.
  • A bad payload never blocks the producer’s outbox or the message group behind it.
  • Producers can ship a new payload shape before the schema is updated, and schema versions evolve at their own pace.
  • No ambiguity about what “valid” means across JSON_SCHEMA, XSD and PROTO.

Bad

  • A malformed or misnamed event is accepted. A typo in the type produces an event that matches no subscription and is silently kept, rather than an error to the developer.
  • Bad data is found by the consumer, later and further from the cause. Every consumer must write defensive parsing.
  • The registered schema can disagree with real payloads without anyone being told.
  • The platform cannot offer a “reject on mismatch” guarantee to teams that want one. A producer-side check in the application (using the schema in its own tests or use cases) is the way to get it.
  • Reject on mismatch at ingest. Rejected for the reasons above, mainly the effect on the outbox.
  • Validate and flag, but accept. Would keep the pipeline moving and surface drift. It adds cost to ingest and is not built.
  • Validate in the stream processor, after storage. Moves the cost off the request but still needs somewhere to report failures.
  • No schemas at all. Loses the contract that consumers and code generators use.