AC-015 Contract caught CS-DIFF-001CS-RESP-005CS-RESP-010

Fields are renamed, removed or re-cased

The response does not match the contract

How to run this card's commands yourself

1. The problem

In one sentence

A field that clients read is renamed, removed or written in another case (user_id becomes userId), so the clients that read the old name get nothing.

A story

Between version 1 and version 2 of a User API, a developer renames full_name to name and removes phone. Both fields were required in version 1. A mobile app released last month reads full_name and phone. The moment version 2 goes live, the app shows empty names and phone numbers. Nobody changed the app.

A smaller version of the same story: the server starts answering firstName where the spec says first_name. The data is the same, the names are not.

Why it hurts

Clients bind to field names. A rename is, for the client, the same as a removal plus a new field it does not know. Releases of the server and the clients are not in step, so the old clients break the day the server ships.

  • For developers: a rename done with an IDE refactor feels safe. It is a breaking change to every consumer. A serializer setting (such as a naming strategy) can re-case all fields at once.
  • For managers: this is the most common way a release breaks customers who did not change anything. It needs a deprecation plan, not just a code review.
  • For DevOps: two places can catch it: compare the old and the new spec before release, and check the running server against the spec after release.

Example

Version 2 of the spec no longer has full_name and phone in the 200 response of GET /users/{id}. Comparing the two specs reports both (see the output below).

For the casing case, the spec says snake_case:

required: [user_id, first_name, last_name, email]
additionalProperties: false

and the broken server answers camelCase:

{"email": "alice@example.com", "firstName": "Alice", "lastName": "Smith", "userId": 1}

How to detect it without clrsig

  • Compare the old and the new spec with a diff tool, looking at response schemas.
  • curl -s URL | jq 'keys' and compare with the spec’s property names.

How to fix it

There are two usual causes:

  1. The change was not meant to be breaking (more likely for casing). Restore the old names, or return both for a while.
  2. The change is meant. Then handle it as a breaking change: a new version, a deprecation period, and a note to clients. Update the spec before the server.

To tell which: ask whether any released client reads the old name. If yes, treat it as breaking. Never silence the check.

AC-005 A required field is missing, AC-054 A spec change breaks existing clients, AC-012 An extra field in a closed schema. Failure-catalog demos: FM-004-01 and FM-004-02. See also the site’s Renamed or Removed Response Fields.

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

2. How clrsig helps

Check

  • CS-DIFF-001 Breaking change (oasdiff level ERR): finds the rename and the removal by comparing the two specs. State: caught.
  • CS-RESP-005 Required body field missing: finds a field that the running server no longer sends. State: caught.
  • CS-RESP-010 Undeclared extra property: finds the new camelCase names, but only because the schema is closed. State: partly.

Severity today: failure (exit code 1) for each.

Command

Part 1, compare two spec versions. No server is needed and nothing is sent. From the demo folder:

cd failures/fm-004-01-renamed-removed-field
clrsig diff v1/openapi.yaml v2/openapi.yaml --breaking-only

Exit code: 1 when a change is at or above the level set with --fail-on. Here it is 1.

What you see

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

  [ERR] !  removed the required property `full_name` from the response with the `200` status  GET /users/{id}
  [ERR] !  removed the required property `phone` from the response with the `200` status  GET /users/{id}

2 change(s)  ·  2 breaking

How to read it: [ERR] is the breaking level. Each line names the property, the response and the operation.

Command (the casing case)

Part 2, check the running server. It only reads data (GET). From the demo folder, with Go installed:

cd failures/fm-004-02-field-name-casing
go run broken/main.go &
clrsig run scenarios/detect.yaml --env environments/local.yaml

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

Scenario: fm-004-02 — Field Name Casing Error

  FAIL  GET /users/1 — fields must be snake_case; broken server returns camelCase  200  13ms
         ✓ status eq 200
         ✗ schema: property "firstName" is unsupported
Value:
  {…}
         → [CS-RESP-010] "firstName" is not allowed in the response. Why: The schema forbids properties it does not declare (additionalProperties: false) and the response has "firstName". Where: response body, field firstName. Fix: Stop sending "firstName", or declare it in the schema.

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

How to read it: the first problem reported is the extra field firstName, because the schema is closed. {…} stands for the response object, which is not printed. The required first_name is missing too, but with an OpenAPI 3.0 spec only the first problem is reported. Run it against fixed/main.go and it passes with exit code 0.

Where to look

  • Desktop app: Contracts shows a spec’s operations and last result; Check Conformance runs the server check.
  • Reports: clrsig diff and clrsig run can write reports; findings from conform carry checkId in JSON.
  • GitHub Action: for diff, use the base-spec, revision-spec and fail-on inputs. For the demo scenario, use command: run with the scenario and env inputs; it names its spec with specFile. 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

diff tells you which property, in which response, before you ship. The running-server check shows what the server really sends. It cannot know which clients read the old names; use clrsig impact to find which of your own scenarios are affected (AC-056).

Limits

  • diff compares two specs, so a server that does not follow its own new spec is not found by it. Use the response checks for that.
  • Casing is found here because the schema is closed. On an open schema an extra field is legal (CS-GAP-002), and a missing required field is still found.

More ways

Nothing yet.

3. Video brief for Google NotebookLM

VIDEO BRIEF — AC-015 · Fields are renamed, removed or re-cased
Length: 5 to 7 minutes. Language: English. Audience: developers, with a line each for managers and DevOps.
One idea: for a client, renaming a field is the same as removing it, so a rename that clients read is a breaking change.
Open with this story: Between version 1 and version 2 of a User API, a developer renames full_name to name and removes phone. Both were required in version 1. A mobile app released last month reads the old names. The moment version 2 goes live, the app shows empty names and phone numbers, and nobody changed the app.
Say these facts, in this order:
1. Clients bind to field names. A rename is, for the client, a removal plus a new field it does not know.
2. Servers and clients are not released in step, so old clients break the day the server ships. A serializer setting can re-case all fields at once.
3. Part one needs no server: clrsig diff compares the two specs. With only breaking changes shown, it reports that the required properties full_name and phone were removed from the response, at the breaking level, ERR.
4. Part two checks the running server. The spec says snake_case names; the broken server answers camelCase.
5. In that output, the line with the cross says the property firstName is unsupported. The three dots in braces stand for the response object, which is not printed. The line with the arrow gives the check ID, why it fails, where it is, and how to fix it.
6. It is reported because the schema is closed. The required first_name is missing too, but with an OpenAPI 3.0 spec only the first problem is reported.
7. Two usual causes: the change was not meant to be breaking (restore the old names, or return both for a while), or it is meant (a new version, a deprecation period, a note to clients, and update the spec before the server).
8. To tell which: ask whether any released client reads the old name. Never silence the check.
9. To find which of your own scenarios a spec change affects, clrsig has an impact command. It cannot know which of your clients read the old names.
10. For managers: this is the most common way a release breaks customers who changed nothing; it needs a deprecation plan.
11. For DevOps: compare the old and new spec before release, and check the running server against the spec after release.
Show on screen: the required list in snake_case and the camelCase response body; the commands (clrsig diff v1/openapi.yaml v2/openapi.yaml --breaking-only, then go run broken/main.go and clrsig run scenarios/detect.yaml --env environments/local.yaml); and the two output blocks, copied exactly from the card.
Name the checks: CS-DIFF-001, Breaking change; CS-RESP-005, Required body field missing; CS-RESP-010, Undeclared extra property. Say the clrsig version: v0.21.0.
Explain these words once: breaking change (a change that can break existing clients); snake_case and camelCase (two ways to write names: first_name and firstName); deprecation (announcing that something will be removed, with time to move); exit code (0 clean, 1 a finding, 2 the setup or the spec is broken).
Say what clrsig does not see here: diff compares specs, so a server that does not follow its own spec is not found by it; on an open schema an extra field is legal, though a missing required field is still found; 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 diff sends nothing and the demo only sends GET requests.
Finish with three recap questions:
1. Why is a rename a breaking change? (A client cannot find the old name.)
2. Which command needs no server? (clrsig diff.)
3. Why did the server check name firstName and not the missing first_name? (With an OpenAPI 3.0 spec only the first problem is reported.)
Tease the next video: AC-016 · Malformed JSON that parsers read differently.
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.