AC-021 Conformance caught CS-RESP-001

The route exists, but not for that HTTP method

The spec and the server disagree about what exists

How to run this card's commands yourself

1. The problem

In one sentence

The spec says an operation uses one HTTP method (for example PATCH), and the server only implements another (for example PUT) on the same path.

A story

The spec declares PATCH /wrong-method to update a record. The team that built the server wrote PUT. The path exists, so a quick look at the routes says “implemented”. A client that follows the spec sends PATCH and gets 405 Method Not Allowed. The spec never declared 405.

Why it hurts

Clients are generated from the spec. The method is part of the operation. A mismatch means the operation, as documented, does not work, even though the path is alive.

  • For developers: PUT replaces a whole record, PATCH changes part of it. They are not interchangeable, so the fix is not “use the other one”.
  • For managers: the documentation and the service disagree on a basic point. Integrations that follow the documentation fail on the first call.
  • For DevOps: a full conform run after each deploy catches this the day it is introduced. Run it against a test environment.

Example

The spec fragment:

/wrong-method:
  patch:
    operationId: wrongMethod
    summary: The spec says PATCH, the server only accepts PUT
    responses:
      "200":
        description: Updated

The server, when asked directly:

PUT   /conform-fail/wrong-method  ->  200 OK
PATCH /conform-fail/wrong-method  ->  405 Method Not Allowed   (allow: PUT)

A second fixture, /orphan, shows the same problem for DELETE: the spec declares DELETE /orphan (204), the server implements POST /orphan only, and DELETE answers 405.

How to detect it without clrsig

  • curl -i -X PATCH URL and read the status and the allow header, which lists the methods the route accepts.
  • Compare the routes the framework registers (method and path) with the operations in the spec.

How to fix it

There are two usual causes:

  1. The code is wrong (more likely, when the spec was agreed first). Implement the declared method with the declared behaviour.
  2. The spec is wrong. The server’s PUT is the real design. Change the spec to put and tell clients, as it is a breaking change.

To tell which: ask which method clients have been told to use. Never silence the check.

AC-020 A documented route does not exist, AC-022 A route on the server is not in the spec, AC-001 The server answers a status the spec never listed. See also the failure-catalog demo FM-034-02 (an unsupported method returns the wrong status).

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). A wrong method shows as an undeclared 405.

Command

--paths limits the run to this one operation. It is a PATCH with a body built from the spec, so it writes data if the server accepts it:

Safety. Run this against a test server, never production. clrsig conform sends POST, PUT and DELETE requests built from the spec: start with --read-only, and take secrets from the environment (${NAME}), never from files in the repository.

clrsig conform specs/conform-fail.yaml \
  -b http://localhost:8080/conform-fail \
  --env clrsig/environments/conform-fail.yaml \
  --paths /wrong-method --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 75 operations that --paths skipped are left out by grep -v '^ SKIP'; no line is edited.

conform-fail API  1.0.0
Base URL: http://localhost:8080/conform-fail
Limited by --paths /wrong-method

  FAIL  PATCH   /wrong-method  405  16ms
         ✗ PATCH /wrong-method answered 405, but the spec declares only 200
         → [CS-RESP-001] Status 405 is not declared for PATCH /wrong-method. Why: The spec lists the responses PATCH /wrong-method may return (200) and 405 is not one of them. A 405 means the server does not accept this method on this path: the route may be missing for this method on the server, or the method in the spec is wrong. The server's answer: {"detail":"Method Not Allowed"}. Where: response status 405 (spec: PATCH /wrong-method → responses). Fix: Add the method to the server's route, or correct the method in the spec. Add 405 to PATCH /wrong-method → responses only when the server is meant to refuse it.

FAILED  76 operations  ·  0 passed  ·  1 failed  ·  75 skipped  18ms

How to read it: the method, the path and the status are in the first line. Nothing says “wrong method”; the signal is 405.

The explanation says that a 405 means the server does not accept this method on this path: the route may be missing for this method, or the method in the spec is wrong. It prints the server’s answer ({"detail":"Method Not Allowed"}). Adding 405 to the spec is only right if 405 is a wanted answer.

Where to look

  • Desktop app: Check Conformance lists the operation as failed under “undeclared status”.
  • Reports: with --format json, the finding carries "checkId": "CS-RESP-001".
  • Safe first run: --read-only sends only GET and HEAD; this check needs the real method, so run it against a test server.

How clrsig helps you fix it

It names the exact method and path and the status it got. It does not say that another method works on that path. Use curl -i and the allow header for that.

Limits

  • A 405 and a missing route (404) look alike to clrsig (AC-020). If the spec declares 405 for the operation, this check passes.
  • Only the declared methods are called. A method the spec does not list is never tried.

More ways

Nothing yet.

3. Video brief for Google NotebookLM

VIDEO BRIEF — AC-021 · The route exists, but not for that HTTP method
Length: 5 to 7 minutes. Language: English. Audience: developers, with a line each for managers and DevOps.
One idea: the method is part of the operation; a spec that says PATCH and a server that only accepts PUT disagree about what exists, even though the path is alive.
Open with this story: The spec declares PATCH on a path to update a record. The team that built the server wrote PUT. The path exists, so a quick look says implemented. A client that follows the spec sends PATCH and gets 405 Method Not Allowed. The spec never declared 405.
Say these facts, in this order:
1. The spec declares PATCH with a 200 answer. The server accepts PUT and answers 405 to PATCH, with an allow header that lists PUT.
2. PUT replaces a whole record and PATCH changes part of it; they are not interchangeable.
3. A second fixture does the same for DELETE: the spec declares DELETE, the server implements POST.
4. clrsig reports it as an undeclared status: 405 is not in the list of declared statuses.
5. Two usual causes: the code is wrong (implement the declared method), or the spec is wrong (change it to the method the server has, which is a breaking change).
6. The explanation says that a 405 means the server does not accept this method on this path, and that adding 405 to the spec is only right if 405 is a wanted answer.
7. For managers: documentation and service disagree on a basic point.
8. For DevOps: a full conform run after each deploy catches this the day it is introduced.
Show on screen: the spec fragment, the two server answers, the command (clrsig conform specs/conform-fail.yaml -b http://localhost:8080/conform-fail --env clrsig/environments/conform-fail.yaml --paths /wrong-method --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: HTTP method (the verb of a request, such as GET, PUT, PATCH or DELETE); 405 (the status for method not allowed); operation (one method on one path); exit code (0 clean, 1 a finding, 2 setup or spec broken).
Say what clrsig does not see here: a 405 and a missing route look alike; if the spec declares 405 for the operation this check passes; a method the spec does not list is never tried.
Safety line (if a write is shown): Run this against a test server, never production. clrsig conform sends POST, PUT and DELETE requests built from the spec: start with --read-only, and take secrets from the environment (${NAME}), never from files in the repository.
Finish with three recap questions:
1. Which method did the spec declare, and which did the server accept? (PATCH; PUT.)
2. Which header lists the methods a route accepts? (allow.)
3. When is adding 405 to the spec the right fix? (Only when 405 is a wanted answer.)
Tease the next video: AC-022 · A route on the server is not in the spec.
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.