Imagine a notebook client that saves an entry by sending just its title. A server update now asks which notebook the title came from. The client still sends exactly the request that worked yesterday. Would a build that regenerates the server’s schema catch the problem?
In an earlier MetaboliQ Brain engineering check, two regenerated interface contracts matched the checked-in files byte for byte. That gave the team evidence that the generated files were current for the revision under test. To answer what an older client could send, we needed a different comparison: hold the request fixed and change the schema that receives it.
Change one requirement
We built two synthetic JSON request schemas for a notebook entry. Both described title and source as strings. Version one required title and allowed source to be omitted. Version two added source to the required list. The property names and their types stayed the same.
We passed the same three JSON objects to both schemas using PowerShell 7.6.9’s Test-Json validator. The first object represents an older client. The second supplies both fields. The third deliberately uses a number for title.
| Request body | Version one | Version two |
|---|---|---|
| {"title":"Juniper"} | Accepted | Rejected |
| {"title":"Juniper","source":"notebook"} | Accepted | Accepted |
| {"title":42} | Rejected | Rejected |
Why keep the old request?
Testing only the two-field example would have given us two passes. Keeping the title-only example exposed the change that mattered to the older writer. The numeric title provided a control: version one already rejected it, so its failure under version two would tell us nothing about a regression.
For a request-schema change, a small release check follows naturally. Save representative requests from the oldest client you intend to support. Run them against the current schema and the proposed schema. Look at the requests that move from accepted to rejected, and decide whether each client needs a migration. A fixture generated afresh from the proposed schema can quietly fill in the very field the old client omits.
These six observations cover request-body validation for a fictional interface. We did not run an older Brain client, call a server, or observe a Brain compatibility failure. A deployed API could also supply defaults or transform a request before validation. To establish what a real client experiences, the same saved request has to go through that API’s normal entry point.
← All engineering articles