A blank phone field can turn into an omitted property, null or an empty string. The distinction between JSON null vs missing affects what the receiving system is allowed to infer. Do not replace one representation with another until you know the contract.
For a sample contact record, compare these forms:
| Representation | What the file actually says |
|---|---|
{} |
No phone property was supplied |
{"phone":null} |
The phone property has a null value |
{"phone":""} |
The phone property contains an empty string |
The file alone does not tell you which form means “unknown,” “clear the old value” or “leave it unchanged.” That meaning belongs to the contract.
Do not clean away a distinction you need
The JSON Schema null reference explicitly notes that null is not equivalent to absence. A required property can also need separate rules for its permitted value.
Suppose a sample update API treats an omitted phone property as “keep the current phone,” while null means “remove it.” Replacing every missing value with null would change the requested operation. Another API might reject null entirely. Check the actual documentation before choosing a cleanup rule.
JSON Formatter can make these representations easier to inspect. It cannot choose the business meaning of an omitted field for you.
Generated types need the same review
JSON to TypeScript infers models from the values you supply. Its null-handling options are choices about generated output, not evidence that a receiving API treats optional properties and null values interchangeably.
Include representative examples when reviewing a contract: an ordinary value, a null, an empty string and an omitted property where each is allowed. Then confirm how the receiver responds through an authorized test workflow.
Avoid a global replacement simply to make the file look consistent. Consistency is useful when the representations carry the same meaning; it is destructive when it erases a distinction.
For a handoff, state the rule beside the field description. “phone may be omitted; null explicitly clears it” is useful only if that is the documented behavior of the actual system. Preserve the rule in validation and export steps, so the same record does not silently change meaning as it moves between formats.