jsonnorm / JSON null vs missing

Technical guide · loss-aware CSV

JSON null and missing are not the same fact.

A CSV cell cannot carry every distinction unless you choose a representation. jsonnorm makes the default loss visible and lets you choose literal null text when that is the right contract.

The difficult example: same empty cell, different source state

Record two has no a key. Record one has a: null. Record three has a concrete value and an explicit null in b. Under the default both-empty policy, the first two facts intentionally render alike, and preview reports that loss.

Input JSON

[
  {"a":null,"b":1},
  {"b":2},
  {"a":3,"b":null}
]

Resulting CSV (default)

a,b
,1
,2
3,

Policy decision: switch Null values to “Literal null” when downstream consumers must distinguish explicit null from a missing key. The union schema still keeps both a and b as columns.

Why this matters downstream

  • Analytics often treats explicit null as known absence and missing as a producer/schema problem.
  • Empty CSV cells are convenient but lossy; the preview warning records that choice before download.
  • The policy is conversion-wide and deterministic, so the same input does not change meaning between runs.

Test your null/missing mix against the actual preview warning.

Open the JSON converterOpen in examples