top of page

JSON Configuration Updates: Keep Null, Missing and Zero Distinct

Nov 5
3 min read

A configuration update that includes null may remove a setting rather than mark it unknown. Before connecting telemetry transformations to a configuration API, verify the update format and define what omission, zero and explicit null mean. Similar-looking JSON documents can have very different effects.


Original conceptual illustration of json configuration updates; not a specific product or live software screen

Original conceptual illustration; not a specific product, live software screen or customer installation.


Key takeaways


  • Merge-patch null removes an object member.

  • Omitted members and zero behave differently.

  • Application consequences need separate verification.


1. Identify the operation before interpreting the value


An incoming measurement object and a configuration patch are different operations. The same JSON token can carry a domain meaning in one and an update instruction in the other. Record the endpoint, method, content type and documented operation before deciding how an absent or null field should be handled.


RFC 7396 specifies JSON Merge Patch, with media type application/merge-patch+json. Do not apply its semantics to every endpoint accepting JSON or every HTTP PATCH method. An API can use a completely different patch format, a field mask or explicit command objects.


2. Understand merge-patch field behaviour


Within a merge-patch object, an omitted member leaves the corresponding target member unaffected. A member with null removes that target member. A value of zero is an ordinary JSON number, not a deletion instruction. That difference matters for limits, offsets, reporting periods and optional metadata.


Objects are processed recursively, while arrays are replaced as values rather than edited element by element. A non-object patch replaces the whole target value under the RFC algorithm. Restrict accepted operations to the contract you intend; do not let a generic serializer choose an update strategy implicitly.


3. A hypothetical settings example


Imagine a target object with highLimit 80 and offset 2. A merge patch containing only offset 0 changes the offset and preserves highLimit. A patch containing highLimit null removes highLimit. An empty object makes neither of those member changes.


Whether removing highLimit disables an alarm, restores a default or is rejected depends on the application’s own rules. The patch format does not define those consequences. The acceptance test must inspect the resulting configuration and its approved behaviour rather than infer it from the request alone.


Original explanatory workflow for json configuration updates: keep null, missing and zero distinct

Original explanatory diagram. Hypothetical values and proposed checks are described in the text; this is not a product specification or field result.


4. Protect the serializer boundary


Check whether the tool building the request emits null for every field not shown in a form. A convenient complete-object serializer can unintentionally turn omitted controls into removal instructions. Conversely, suppressing every null can prevent an intentional deletion from reaching the server.


Use synthetic configuration records to test a missing member, explicit null, numeric zero, empty string and an array replacement. Record which requests are valid and what remains afterwards. Treat validation errors as evidence to investigate, not as a reason to substitute an arbitrary default value.


  1. Confirm the endpoint and declared update format.

  2. Test omission, null and zero independently.

  3. Inspect the full resulting configuration.

  4. Document intended deletion and recovery behaviour.


5. Make changes reviewable and reversible


Retain the baseline, intended change and read-back result. Where documented, use the endpoint’s concurrency protection so a reviewed patch cannot silently collide with another editor. Keep a recovery method appropriate to the equipment and test it separately from generating the patch.


This article explains a public data-format standard and proposed integration checks. It does not claim that ProSight Software configuration uses JSON Merge Patch or exposes particular controls. Supply the exact API contract and a sanitised example to confirm the supported approach for your deployment before changing operational settings.


Related guide and project resources




Technical references



Need help with your application?


Send the relevant point list, equipment documentation and a sanitised example of the behaviour you need to verify. Confirm the available functions and integration requirements for the exact equipment and deployment.










Comments


prosight-software-logo (1).png
bottom of page