1. The problem
In one sentence
The spec lists the statuses an operation can answer, and the server answers one that is not on the list.
A story
A mobile app calls GET /cases/resp-001-undeclared-status. The spec says it answers 200 with a widget, or 404 with an error. One night the database is slow and the server answers 500 Internal Server Error with {"code": "boom", "message": "internal error"}. The app has code for 200 and 404 only. It treats the unknown status as a success, reads no widget, and shows an empty screen.
Why it hurts
Clients are written from the spec. A status nobody planned for is often handled as success, or it crashes the client.
- For developers: the error path is the least tested code. An undeclared
500,503or429shows that the spec and the real failure modes have drifted apart. - For managers: a customer sees a blank screen or a crash instead of a clear message. The cause is a gap between what the team promised and what the service does under stress.
- For DevOps: a
5xxduring a check run is a signal, not noise. Fail the build on exit code1, and decide which statuses to declare (for example503for planned maintenance) so the spec tells clients what to retry.
Example
The spec fragment declares two statuses:
responses:
"200":
description: A widget
"404":
description: Not found
The server answers:
HTTP/1.1 500 Internal Server Error
content-type: application/json
{"code": "boom", "message": "internal error"}
500 is not in the list, so the answer breaks the contract. If the spec has a default response, or a range such as 2XX, that counts as declared: the fixture resp-001b-default-response-ok answers 503 and passes for that reason.
How to detect it without clrsig
curl -s -o /dev/null -w '%{http_code}\n' URLand compare the number with theresponsesof the operation in the spec.- In logs, count the statuses per route and compare the list with the spec.
How to fix it
There are two usual causes:
- The code is wrong (more likely for
500). An unhandled error escaped. Fix the bug, or catch it and answer with a declared error. - The spec is incomplete. A status such as
429or503is real and wanted. Declare it, with its body, so clients can handle it.
To tell which: ask whether a client should ever see this status on purpose. A 500 is almost always a bug. A 404, 409 or 429 is often a missing declaration. Never silence the check.
Related problems
AC-002 Wrong Content-Type, AC-020 A documented route does not exist, AC-034 Wrong HTTP status for a business error. See also the failure-catalog demo FM-025-01 and the site’s Incorrect HTTP Status and Business-Error Semantics.
Words used on this page are explained once in the glossary.
2. How clrsig helps
Check
CS-RESP-001 Undeclared response status. State: caught. Severity today: failure (exit code 1).
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-001-undeclared-status --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-001-undeclared-status
FAIL GET /cases/resp-001-undeclared-status 500 16ms
✗ GET /cases/resp-001-undeclared-status answered 500, but the spec declares only 200, 404
→ [CS-RESP-001] Status 500 is not declared for GET /cases/resp-001-undeclared-status. Why: The spec lists the responses GET /cases/resp-001-undeclared-status may return (200, 404) and 500 is not one of them: the server returned something the spec does not describe, or the spec is incomplete. The server's answer: {"code":"boom","message":"internal error"}. Where: response status 500 (spec: GET /cases/resp-001-undeclared-status → responses). Fix: Make the server answer a declared status, or add 500 (or a default response) to GET /cases/resp-001-undeclared-status → responses in the spec.
FAILED 37 operations · 0 passed · 1 failed · 36 skipped 17ms
How to read it: the ✗ line gives the status the server sent and the statuses the spec lists. The → line adds the check ID, why it matters, where in the spec, and two ways to fix it.
Where to look
- Desktop app: Check Conformance lists the operation as failed, grouped under “undeclared status”. Help, What We Check lists
CS-RESP-001. - Reports: with
--format json, the finding carries"checkId": "CS-RESP-001". The JUnit, HTML and Markdown reports show the same text. - GitHub Action: it runs the same command; use its
explainandformatinputs. - In a scenario: a step with a spec runs this check automatically.
How clrsig helps you fix it
It lists the statuses the spec does declare and says the fix can be on either side. It cannot tell you whether a 500 is a bug or a real case that needs declaring.
Limits
- A
schemaassertion that names an operation fails when the operation does not declare the status (releases before v0.21.0 could pass it without reading the body). A schema written inside the scenario checks the body whatever the status is: add astatusassertion, or run the step with a spec. - 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.
More ways
Nothing yet.
3. Video brief for Google NotebookLM
VIDEO BRIEF — AC-001 · The server answers a status the spec never listed
Length: 5 to 7 minutes. Language: English. Audience: developers, with a line each for managers and DevOps.
One idea: if the spec lists the statuses an operation can answer, a status outside the list is a broken promise, even when it is "just an error".
Open with this story: A mobile app calls an operation that the spec says answers 200 with a widget, or 404 with an error. One night the database is slow and the server answers 500 with "internal error". The app only has code for 200 and 404. It treats the unknown status as a success, finds no widget, and shows an empty screen.
Say these facts, in this order:
1. The spec declares 200 and 404 for this operation. The server answered 500, which is not on the list.
2. Clients are written from the spec. A status nobody planned for is often handled as success, or it crashes the client.
3. A default response, or a range such as 2XX, counts as declared. The sandbox has an example that answers 503 and passes because of a default response.
4. For managers: a customer sees a blank screen or a crash instead of a clear message, because of a gap between what the team promised and what the service does under stress.
5. For DevOps: a 5xx during a check run is a signal, not noise. Fail the build on exit code 1, and decide which statuses to declare, for example 503 for planned maintenance.
6. To find it without clrsig: print only the status code with curl and compare it with the operation's responses in the spec, or count the statuses per route in the logs.
7. clrsig finds it with the check "Undeclared response status". In the output, the line with the cross says which status came back and which ones the spec declares. The line with the arrow gives the check ID, why it matters, where it is in the spec, and two ways to fix it.
8. There are two usual causes. The code is wrong: an unhandled error escaped, the likely cause for a 500. Or the spec is incomplete: a real, wanted status such as 429 or 503 was never declared.
9. To tell which: ask whether a client should ever see this status on purpose. Then fix the code, or declare the status with its body. Never silence the check.
10. The same finding appears in the JSON report as a check ID, in the other report formats as the same text, in the GitHub Action, and in the desktop app. In a scenario, a step that has a spec runs this check automatically.
11. In a scenario, a schema assertion that names an operation also fails on a status the operation does not declare. A schema written inside the scenario is different: it checks the body whatever the status is, so add a status assertion.
Show on screen: the two declared statuses; the 500 response with its body; the command (clrsig conform specs/contract-fail.yaml -b http://localhost:8080/contract-fail --env clrsig/environments/contract-fail.yaml --paths /cases/resp-001-undeclared-status --explain); and the output block, copied exactly from the card.
Name the check: CS-RESP-001, Undeclared response status. Say the clrsig version: v0.21.0.
Explain these words once: OpenAPI spec (the written promise of what an API accepts and returns); status code (the number that says how a request went); declared (listed in the spec); exit code (0 clean, 1 a finding, 2 the setup or the spec is broken); assertion (a check written in a scenario step).
Say what clrsig does not see here: it cannot tell whether a 500 is a bug or a real case that should be declared. A schema written inside a scenario does not look at the status. A schema assertion that names an operation does fail on an undeclared status in this version, but releases before it could pass without reading the body, so do not rely on an older release. With an OpenAPI 3.0 spec, as here, only the first problem in a response body is reported.
Safety line (if a write is shown): not needed, this command sends one GET.
Finish with three recap questions:
1. Which statuses did the spec declare, and which did the server send? (200 and 404; 500.)
2. You use a schema written inside a scenario step. Does it check the status? (No. Add a status assertion, or run the step with a spec.)
3. Name the two usual causes. (The code has a bug, or the spec is incomplete.)
Tease the next video: AC-002 · The Content-Type is not the one the spec promised.
Do not: say "contract testing" alone; say clrsig "catches everything"; invent flags, IDs or numbers; read tables aloud; use any fact that is not in the card.