A JSON formatter can tell you whether a document is syntactically valid. It cannot tell you whether the data means what the receiving system expects. An API might need an array of objects, while you send one object. A field that looks numeric may be a string. A missing property, an explicit null, and an empty string can have different meanings. Good validation has two stages: parse the text, then inspect the shape.
GoldieKit's JSON formatter helps with the first stage by showing syntax clearly. The focused syntax guide explains common punctuation errors. This article focuses on the structural mistakes that remain after parsing succeeds.
Objects, arrays, and primitive values
An object groups named properties. An array holds an ordered sequence. JSON also supports strings, numbers, booleans, and null. The top-level value can be any valid JSON value, but a particular API may demand a specific one.
{
"customerId": "00123",
"items": [
{ "sku": "BOOK-1", "quantity": 2 }
],
"gift": false,
"note": null
}
In this example, customerId is a string because leading zeros are part of the identifier. quantity is a number because arithmetic may be performed on it. items is an array even when it contains one item. note is present with a null value, which may be different from omitting it entirely. These choices are semantic, not formatting preferences.
Syntax checks do not enforce a contract
Suppose a service expects items to be an array. This document is valid JSON but may be rejected:
{ "items": { "sku": "BOOK-1", "quantity": "2" } }
The object is in place of an array, and the quantity is a string. A formatter will indent it perfectly because the punctuation is correct. Compare the result with the receiving API's examples or schema. If you control the system, define the accepted types and required fields explicitly. Automated schema validation belongs in the application that consumes or produces the data.
| Value | Possible meaning | Why it matters |
|---|---|---|
| Property omitted | No value supplied | May trigger a default |
null |
Explicitly no value | May clear an existing value |
"" |
Empty text | Still a string value |
0 |
Numeric zero | Not the same as no value |
"0" |
Text containing zero | May fail numeric validation |
Watch data imported from CSV
CSV cells do not carry a universal type system. A converter can produce JSON objects, but it cannot know whether 00123 is a product identifier, whether TRUE is a boolean, or whether 2026-11-16 should remain text. Use CSV to JSON to make a first pass, then inspect representative rows before importing a whole file. The CSV-versus-JSON article explains where each format is useful.
Cosmo tip: Test a row with an empty field, a quoted comma, and a leading-zero identifier. Ordinary rows often hide the shape mistakes.
A reliable review sequence
Paste the JSON into the formatter and fix syntax errors. Read the top-level value: object or array? Check nested collections and the type of each important property. Look for misspelled keys, unexpected capitalization, and fields that sometimes change type. Compare with the receiving contract. Use a small representative payload in a safe test environment before sending a full batch.
If you minify JSON with JSON minifier, do it after you understand the structure. Minification changes whitespace, not meaning, and makes manual review harder. Keep a readable copy for debugging. Avoid putting private tokens or personal data into third-party examples or issue reports; redact them first.
Check consistency across a collection
One correct-looking object does not prove that a whole array is consistent. Inspect an item near the beginning, middle, and end, plus a record with optional fields. If quantity is numeric in most items but text in one, the receiving program may fail only for that record. If an object sometimes uses customerId and sometimes customerID, the fields are different keys. Sorting properties or pretty-printing will not reconcile them.
When an API documents a schema, use that schema as the contract. A schema validator can enforce required keys, allowed values, and nested shapes. GoldieKit's formatter is a readable inspection aid, not a schema validator. For a production integration, test valid examples, missing fields, wrong types, and boundary values in the application that owns the contract.
Common mistakes
JSON has no comments, trailing commas, or undefined value. A JavaScript object literal can contain features JSON cannot. Dates are usually represented as strings, but their format and time-zone meaning must be agreed upon. Very large integers may lose precision in some consumer environments; identifiers should not be converted to numbers merely because they contain digits. Valid text is a starting point, not proof that the data is correct.
Worked example: an API accepts the payload but misreads it
Imagine a service that returns success for a customer update, yet the delivery note disappears. The JSON parses and the HTTP request succeeds. Compare your payload with the documented shape: perhaps the API expects delivery.instructions as a nested string, while you sent a top-level deliveryInstructions. The server may ignore unknown fields rather than reject them. A formatter cannot detect that mismatch, but a contract comparison can.
Write a minimal valid example from the API documentation and a minimal example of your actual payload. Compare keys, nesting, and types line by line. Test one field at a time in a development environment and inspect the stored result, not just the response status. If the service exposes validation errors, capture them without copying personal data into a public ticket. This method turns a vague “JSON problem” into a precise mapping problem.
Add a deliberately wrong example
A validation routine is more trustworthy when it rejects a realistic mistake. For an order payload, test quantity as "2", an absent currency, and an extra unexpected property. A formatter can make each payload valid JSON while leaving the contract wrong. Compare the output to the API schema or receiving code, and preserve an example of an accepted payload so future changes can be checked against it.