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.
Runnable examples
- FM-022-01 semantically-invalid
- FM-022-02 filter-ignored
- FM-022-03 enum-violation
- FM-022-04 sort-order
- FM-022-05 limit-ignored
- FM-022-06 case-insensitive-enum
- FM-022-07 empty-string-accepted
- FM-022-08 conditional-required
- FM-022-09 id-mismatch
Each example includes a broken server, a fixed server, an OpenAPI spec, and a clrsig scenario that detects the failure.
In the field
- STORY-022 primary The Payload That Was Valid JSON but Invalid Business Data
- STORY-009 related The HL7 Healthcare Exchange Issue
- STORY-037 related The Search Parameter That Became a Database Command
- STORY-040 related The Invoice Header That Survived Without Its Line Items
- STORY-046 related The Name That Changed Between the API and the Archive