FM-022 Time, State, and API Lifecycle

Syntactically Valid but Semantically Invalid Payloads

Valid JSON that violates business rules: an unavailable product, a date outside the permitted period, or cross-field constraints that schema alone cannot enforce.

Failure explanation

A request is valid JSON and may even satisfy the OpenAPI schema, but violates domain rules or relationships between fields. Structural validation cannot determine every business invariant. Examples include a delivery date before the order date, a quantity exceeding available stock, an invalid state transition, or a currency incompatible with the account.

Example

{"startDate":"2026-05-10","endDate":"2026-05-01"} is valid JSON and both fields are valid dates, but the interval is invalid for a booking.

How to test

  • Define domain rules separately from structural schema constraints.
  • Test cross-field dependencies, reference integrity, business-state transitions, boundaries, and conflicting values.
  • Include valid-looking combinations that should be rejected.
  • Verify stable machine-readable error codes and field-level diagnostics.

Expected behavior

The API accepts structurally and semantically valid requests and rejects invalid business combinations with documented, actionable errors.