Hacker News new | ask | show | jobs
by palotasb 848 days ago
Raw integers are also valid JSON according to the spec: https://www.json.org/json-en.html

json is defined as one element

element is defines as ws (whitespace), value, ws

value is defined as one of: object, array, string, number, "true", "false", "null"

Wrapping in {} to make an object or in [] to make a list (which is also not an object) is not necessary to make a valid JSON document. This is also discussed in the Stack Overflow question linked.