AC-025 Conformance caught CS-RESP-005

The wrong API version answers

The spec and the server disagree about what exists

How to run this card's commands yourself

1. The problem

In one sentence

A request to the new version of an API (/v2/…) is answered with the old version’s shape, because the router sends both versions to the same handler.

A story

Version 2 of a product API adds a required field, sku. The router sends /v1/products and /v2/products to the same handler “for now”. Clients that moved to /v2/products expect a sku on every product. The answer is in the version 1 shape: id, name and price, and no sku.

Why it hurts

A version is a promise: “this path has this shape”. If the path does not deliver the version it names, clients cannot trust the number in the URL.

  • For developers: a version prefix is easy to route and hard to implement. Each version needs its own response model, not only its own path.
  • For managers: clients that moved to the new version, which is what you asked them to do, are the first to break.
  • For DevOps: test each version against its own spec in the pipeline, not only the latest one.

Example

The version 2 spec requires sku:

Product:
  type: object
  required: [id, name, price, sku]
  properties:
    sku:
      type: string
      description: Stock-keeping unit — new in v2

The broken server answers GET /v2/products with the old shape:

{"items":[{"id":1,"name":"Widget","price":9.99},{"id":2,"name":"Gadget","price":24.99}]}

How to detect it without clrsig

  • curl -s URL/v2/products | jq '.items[0] | keys' and compare with the version 2 spec.
  • Call both /v1/… and /v2/… and compare: identical bodies mean one handler serves both.

How to fix it

There are two usual causes:

  1. The code is wrong (more likely). Give version 2 its own handler or response model that adds sku.
  2. The spec is wrong. sku is not ready yet. Then keep it optional in the version 2 spec until it is.

To tell which: ask whether clients of /v2 already rely on sku. Never silence the check.

AC-015 Fields are renamed, removed or re-cased, AC-054 A spec change breaks existing clients, AC-005 A required field is missing. Failure-catalog demo: FM-007-01. See also the site’s API Versioning and Compatibility Failures.

Words used on this page are explained once in the glossary.

2. How clrsig helps

Check

CS-RESP-005 Required body field missing, found because the scenario names the version 2 spec. State: caught. Severity today: failure (exit code 1).

Command

This demo is a runnable server in the failure catalog. It only reads data (GET). From the demo folder, with Go installed:

cd failures/fm-007-01-version-routing
go run broken/main.go &
clrsig run scenarios/detect.yaml --env environments/local.yaml

The scenario binds the step to the version 2 spec (specFile: ../openapi.yaml) and calls GET /v2/products with no assertions of its own: the spec check does the work.

Exit code: 0 clean, 1 a step failed, 2 the scenario or the setup is broken. Here it is 1.

What you see

Output from clrsig v0.21.0, recorded on 2026-11-30:

Scenario: fm-007-01 — API Version Routing

  FAIL  GET /v2/products — each product must include the required sku field  200  18ms
         ✗ schema: Error at "/items/0/sku": property "sku" is missing
         → [CS-RESP-005] "sku" is missing from the response. Why: The spec marks "sku" as required, but the server's response did not include it. Where: response body, field items[0].sku. Fix: Return "sku" from the server, or make it optional in the spec if it is not always present.

FAILED  0 passed, 1 failed, 0 skipped  (0/1 assertions passed)  18ms

How to read it: the path is /items/0/sku, so the first product is missing sku. Run it against fixed/main.go and it passes with exit code 0.

Where to look

  • Desktop app: open the scenario and run it; the failed step shows the same finding.
  • Reports: use --format json or junit on clrsig run.
  • GitHub Action: use command: run with the scenario and env inputs. Use one run per version. The demo’s scenario names its spec with specFile, so responses are compared with it. To compare your own responses with your spec, name it with specFile in the scenario, or give the spec input, which replaces it; older releases of the Action ignored that input with run (setup and upgrading).

How clrsig helps you fix it

It names the missing field and its path in the body (items[0].sku). It does not know that the handler is shared.

Limits

  • The check needs the version 2 spec. A scenario with no spec, or the wrong one, would not see this.
  • With an OpenAPI 3.0 spec, as here, only the first problem in a response body is reported. With 3.1, each problem has its own line.

More ways

Nothing yet.

3. Video brief for Google NotebookLM

VIDEO BRIEF — AC-025 · The wrong API version answers
Length: 5 to 7 minutes. Language: English. Audience: developers, with a line each for managers and DevOps.
One idea: a version in the URL is a promise; if the path does not deliver the shape its version names, the number cannot be trusted.
Open with this story: Version 2 of a product API adds a required field called sku. The router sends version 1 and version 2 to the same handler for now. Clients that moved to version 2 expect a sku on every product. The answer has the version 1 shape, with no sku.
Say these facts, in this order:
1. The version 2 spec requires id, name, price and sku. The broken server answers /v2/products without sku.
2. The scenario names the version 2 spec, and calls the path with no assertions of its own; the spec check does the work.
3. The first failing path is items, zero, sku: the first product is missing it.
4. The fixed server adds the field and the run passes.
5. Two usual causes: the code is wrong (give version 2 its own response model), or the spec is wrong because sku is not ready yet.
6. For managers: clients that moved to the new version, as you asked, are the first to break.
7. For DevOps: test each version against its own spec in the pipeline.
Show on screen: the Product schema with sku, the broken answer, the commands (go run broken/main.go and clrsig run scenarios/detect.yaml --env environments/local.yaml), and the output block, copied exactly from the card.
Name the check: CS-RESP-005, Required body field missing. Say the clrsig version: v0.21.0.
Explain these words once: API version (a number in the path, such as v2, that names a shape); handler (the code that answers one route); scenario (a script of steps with your own checks, called assertions); exit code (0 clean, 1 a finding, 2 setup or spec broken).
Say what clrsig does not see here: it needs the right spec for the version; it does not know the handler is shared; with an OpenAPI 3.0 spec only the first problem per response body is reported.
Safety line (if a write is shown): not needed, the demo only sends GET requests.
Finish with three recap questions:
1. What was missing from the version 2 answer? (The sku field.)
2. Why does the scenario need the version 2 spec? (The spec check compares the answer with it.)
3. What is the usual fix? (A response model for version 2 that adds the field.)
Tease the next video: AC-026 · The server drifts away from its 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.