2026-08-30 · 6 min read · Rahul Chitturi
- json
- api
- debugging
A partial update can pass JSON validation and still erase the wrong field. With JSON Merge Patch, a member set to null requests removal, while an omitted member means leave the existing value unchanged.
This is easy to miss when an application also uses null as a meaningful database value or a generated client serializes every optional property.
Confirm the patch contract
Check the request Content-Type and the endpoint specification before changing payloads. A server expecting application/merge-patch+json may interpret null differently from an ordinary JSON update or JSON Patch operation.
- Omit properties that should remain unchanged
- Use null only when the contract defines the intended removal
- Test nested objects because merge behavior is recursive
- Treat arrays as replacements rather than element-level edits
Trace client serialization
Capture a harmless object before serialization, the exact request body, and the stored result. Generated SDKs, form state, and object-spread code can turn missing values into explicit nulls or empty strings.
Compare one known-good update with the failure after formatting both bodies identically. Verify authorization and optimistic concurrency separately from patch semantics.
A Flashman workflow
Use the JSON formatter to inspect omitted and explicit members, the diff tool to compare request bodies and results, the URL tool to verify the endpoint, and the case converter when client field names differ from the API.
Add contract fixtures for omission, null deletion, nested objects, complete array replacement, unknown fields, and concurrent updates.