1. The problem
In one sentence
A field holds null, but the schema does not say that null is allowed.
A story
The spec says a widget name is a string. A new row in the database has no name yet, and the server sends {"id": 1, "name": null}. A Kotlin client with a non-null String property throws while reading the body. A JavaScript client prints “Hello, null”.
Why it hurts
null is not a string, a number or an object. Many languages treat it as a different thing, and some will not accept it at all. The spec is where a client learns which fields may be empty.
- For developers: a database
NULLis the usual source. It passes through the code unchanged and is only noticed by the reader. - For managers: a missing value becomes a crash for some customers, or the word “null” on a screen.
- For DevOps: this appears when real data replaces test data. Run the checks against a data set that has empty values.
Example
The spec fragment:
WidgetNameDoc:
type: object
required: [id, name]
properties:
id: { type: integer }
name: { type: string }
The response from GET /contract-fail/cases/resp-007d-null-not-nullable:
{"id": 1, "name": null}
The field is present (so it is not “missing”), but its value is null, and the schema does not allow that.
How to detect it without clrsig
curl -s URL | jq '.name == null'printstrue.- Search the code and the database for columns that can be
NULLand are returned as they are.
How to fix it
There are two usual causes:
- The spec is silent about empty values (common). The field can really be empty. Say so:
nullable: true(OpenAPI 3.0) or a type that includes"null"(3.1), and tell clients. - The code is wrong. The field should always have a value. Give it a default, or fix the data that produces the
NULL.
To tell which: ask whether an empty name is a real, allowed state. Never silence the check.
Related problems
AC-005 A required field is missing, AC-006 A field has the wrong type, AC-007 A value breaks a rule in the schema. Failure-catalog demos: FM-005-01 and FM-005-02 (nullable and empty-collection failures). 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-007 Value outside the declared constraints, here null where nullable is not set. 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-007d-null-not-nullable --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-007d-null-not-nullable
FAIL GET /cases/resp-007d-null-not-nullable 200 13ms
✗ Error at "/name": Value is not nullable
Value:
null
→ [CS-RESP-007] "name" keeps to a rule the schema sets (Value is not nullable). Why: The schema sets a rule for name: it keeps to a rule the schema sets (Value is not nullable). The server sent null. Where: response body, field name (spec: GET /cases/resp-007d-null-not-nullable → response 200 → body schema). Fix: Send a value the rule allows, or relax the rule in the spec if the server is right.
FAILED 37 operations · 0 passed · 1 failed · 36 skipped 15ms
How to read it: the field is name and the value is null. In the spec, name is a plain string; the output does not print the schema.
Where to look
- Desktop app: Check Conformance lists the failure with the field. Help, What We Check lists
CS-RESP-007. - Reports: with
--format json, the finding carries"checkId": "CS-RESP-007". - GitHub Action: it runs the same command.
- Scenario: a
schemaassertion reports the same problem.
How clrsig helps you fix it
It names the field, shows that the server sent null, and says to send a value the rule allows or to relax the rule in the spec. It cannot tell you whether an empty name is a real state.
Limits
- 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.
- It does not know your data, so it cannot warn about nulls that your test data never produces. Test with data that has empty values.
More ways
Nothing yet.
3. Video brief for Google NotebookLM
VIDEO BRIEF — AC-009 · Null where null is not allowed
Length: 5 to 7 minutes. Language: English. Audience: developers, with a line each for managers and DevOps.
One idea: null is a value of its own; if the spec does not say a field may be null, a null can break clients.
Open with this story: The spec says a widget name is a string. A new row in the database has no name yet, and the server sends name: null. A Kotlin client with a non-null string property throws while reading the body. A JavaScript client prints "Hello, null".
Say these facts, in this order:
1. The schema says name is a string. The server sent null.
2. The field is present, so it is not "missing". Its value is the problem.
3. A database NULL often passes through the code unchanged and is only noticed by the reader.
4. To find it without clrsig: ask with curl and jq whether the field equals null, and search the code and database for columns that can be NULL and are returned as they are.
5. In the output, the line with the cross says the field name is not nullable. Under Value is null, the one value that broke the rule. The line with the arrow gives the check ID, why it fails, where it is, and says to send a value the rule allows or relax the rule in the spec. The output does not print the schema.
6. Two usual causes: the spec is silent about empty values although the field can really be empty (declare nullable in OpenAPI 3.0, or a type that includes null in 3.1, and tell clients), or the code is wrong and the field should always have a value.
7. To tell which: ask whether an empty name is a real, allowed state. Never silence the check.
8. For managers: a missing value becomes a crash for some customers, or the word "null" on a screen.
9. For DevOps: this appears when real data replaces test data, so run the checks against data that has empty values.
10. In a scenario, a schema assertion reports the same problem.
Show on screen: the WidgetNameDoc schema; the response {"id": 1, "name": null}; the command (clrsig conform specs/contract-fail.yaml -b http://localhost:8080/contract-fail --env clrsig/environments/contract-fail.yaml --paths /cases/resp-007d-null-not-nullable --explain); and the output block, copied exactly from the card.
Name the check: CS-RESP-007, Value outside the declared constraints. Say the clrsig version: v0.21.0.
Explain these words once: null (a value that means nothing is here); nullable (the spec says null is allowed); exit code (0 clean, 1 a finding, 2 the setup or the spec is broken).
Say what clrsig does not see here: it does not know your data, so it cannot warn about nulls your test data never produces. 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. Is a field with null the same as a missing field? (No; the field is present with the value null.)
2. How does a spec say that null is allowed? (With nullable, or a type that includes null.)
3. Where does a null often come from? (A database column that can be empty.)
Tease the next video: AC-010 · The body is not valid JSON, or is empty.
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.