1. The problem
In one sentence
The body lacks a property that the schema lists as required.
A story
A client calls GET /widgets/1. The spec says every widget has id, name and price. The server forgot id: it answers {"name": "Alpha", "price": 9.99}. The client uses id as the key to open the detail page. It opens /widgets/undefined.
Why it hurts
“Required” is the strongest promise a schema makes. Clients skip checks for fields that are required, so a missing one often becomes undefined, null or a crash far from the cause.
- For developers: typically caused by a query that no longer selects the column, a serializer that skips empty values, or a renamed property.
- For managers: partial data reaches customers or downstream systems. It may be saved wrong before anyone notices.
- For DevOps: a required field is a clean, stable thing to gate on. Run the check after every deploy against a test environment.
Example
The spec fragment (Widget schema):
Widget:
type: object
required: [id, name, price]
properties:
id: { type: integer }
name: { type: string }
price: { type: number }
The response:
{"name": "Alpha", "price": 9.99}
id is required, and it is not there.
How to detect it without clrsig
curl -s URL | jq 'has("id")'printsfalse.- In a review, compare the fields the code puts into the response with the
requiredlist in the spec.
How to fix it
There are two usual causes:
- The code is wrong (more likely). Return the field. Check every path (cached answers, error branches) that builds this response.
- The spec is wrong. The field is not always present. Then remove it from
requiredso the contract says so.
To tell which: ask whether a client can work without it. If not, the code is wrong. Never silence the check.
Related problems
AC-006 A field has the wrong type, AC-009 Null where null is not allowed, AC-015 Fields renamed, removed or re-cased. Failure-catalog demo: FM-005-03 (a nested required field missing). See also the site’s Incorrect Optional, Nullable, and Required Field Behavior.
Words used on this page are explained once in the glossary.
2. How clrsig helps
Check
CS-RESP-005 Required body field missing. State: caught. Severity today: failure (exit code 1). It is also caught by the schema assertion in a scenario.
Command
--paths limits the run to this one GET, so nothing is written:
clrsig conform specs/contract-fail.yaml \
-b http://localhost:8080/contract-fail \
--env clrsig/environments/contract-fail.yaml \
--paths /cases/resp-005-missing-required-field --explain
Exit code: 0 clean, 1 a finding, 2 the spec or the setup is broken. Here it is 1.
What you see
Output from clrsig v0.21.0, recorded on 2026-11-30. The lines for the 36 operations that --paths skipped are left out by grep -v '^ SKIP'; no line is edited.
contract-fail API 1.0.0
Base URL: http://localhost:8080/contract-fail
Limited by --paths /cases/resp-005-missing-required-field
FAIL GET /cases/resp-005-missing-required-field 200 15ms
✗ Error at "/id": property "id" is missing
→ [CS-RESP-005] "id" is missing from the response. Why: The spec marks "id" as required, but the server's response did not include it. Where: response body, field id (spec: GET /cases/resp-005-missing-required-field → response 200 → body schema). Fix: Return "id" from the server, or make it optional in the spec if it is not always present.
FAILED 37 operations · 0 passed · 1 failed · 36 skipped 16ms
How to read it: the ✗ line names the missing field. The → line adds why it matters, where it is in the spec, and how to fix it. The output does not print the schema or the response body.
Where to look
- Desktop app: Check Conformance shows the failure under “missing field”. Help, What We Check lists
CS-RESP-005. - Reports: with
--format json, the finding carries"checkId": "CS-RESP-005",whereset to the field, andwhyandfixtext. - GitHub Action: it runs the same command.
- Scenario: a
schemaassertion reports the same problem for the body.
How clrsig helps you fix it
It names the field and says the fix may be in the code or in the spec. It cannot tell you why the code dropped the field.
Limits
- With an OpenAPI 3.0 spec, as here, only the first problem in a response body is reported: fix it and run again. With 3.1, each problem has its own line.
- It compares with the spec, not with what the database holds.
More ways
Nothing yet.