top of page

Does Your Data Import Distinguish JSON Null, a Missing Key and SQL NULL?

Oct 26
3 min read

An integration receives one document without a manager field and another with manager explicitly set to null. After extraction, both appear blank. The workflow can no longer tell whether the source omitted the information or deliberately cleared it.


The correct interpretation depends on the contract, but the implementation must preserve the distinction long enough to apply that contract.


Identify the layer you are inspecting


A JSON document, a field inside that document and a SQL column are different layers. A SQL column can be NULL even when other rows contain valid JSON documents with explicit JSON null values.


PostgreSQL's JSON-function reference distinguishes the textual type result “null” for JSON null from an SQL NULL result. It also documents extraction and key-existence operations.


Inspect the document before flattening it into text. A convenient extraction operation may collapse states that the business process needs to distinguish.


Build a state table before coding


Illustrative example: optional manager


Use four fictional inputs: no manager key, manager set to JSON null, manager set to an empty string, and manager set to a known identifier.


A proposed update contract might interpret these as unchanged, cleared, invalid and assigned. That is an illustrative contract, not a universal JSON rule. Another API may define absence differently.


Write the expected stored result and user-visible message for each input. Then include a whole SQL column that is NULL to represent a missing document.


Add a wrong-type value


Send manager as an array or object. The parser may accept the JSON while the field violates the application's expected type.


Do not convert every unexpected value into text and continue. A stringified object can look like a populated identifier while being unusable downstream.


Preserve enough evidence for diagnosis


The validation record should identify which state was received and which rule was applied. It need not copy a full sensitive payload into logs.


For example, record the source message ID, field name, presence flag, detected type and validation outcome. Use a controlled fixture when demonstrating the actual values to reviewers.


If data is flattened into an intermediate table, include a presence indicator when absence has meaning. Otherwise later stages cannot reconstruct information that was discarded.


Review create and update independently


A missing field during creation may require a default, rejection or incomplete-record state. A missing field during an update may mean no change. Explicit null may be accepted in one operation and prohibited in another.


Test both paths with the same state table. Do not assume that sharing a JSON schema gives them identical business semantics.


Also test nested keys. A missing parent object can differ from a present parent whose child is null.


Make the consumer contract visible


Ask the receiving team what each accepted state means. If the source cannot represent a required distinction, address that limitation in the integration design rather than inventing a value.


Read handling unknown JSON fields for the separate question of unexpected properties.


Accept the import when every fixture produces the agreed state and invalid types are identified clearly. The useful outcome is not merely valid JSON or a nonempty database row; it is preservation of the sender's intended change.


Editorial note


Prepared with AI assistance. Primary sources and the FutureOS article inventory were checked on October 26, 2026. Examples are illustrative, not customer results. FutureOS is described as being in prelaunch in its current introduction. This guide does not claim an available product feature, integration or service, and no independent expert review is claimed.


Comments


Commenting on this post isn't available anymore. Contact the site owner for more info.
bottom of page