Payload Lab / JSON syntax and types
JSON syntax and types
Technical notes for working with the tools and examples in this documentation.
| Concept | Example | Notes |
|---|---|---|
| Object | {"id":7} | Unordered name/value members. Duplicate names are not interoperable. |
| Array | [1,2,3] | Ordered list; positions start at zero. |
| String | "hello" | Double quotes are required. |
| Number | -1.25e3 | Decimal exponent notation is allowed. |
| Boolean | true | Only lowercase true or false. |
| Null | null | Explicit absence of a value. |
| Escape | "a\nb" | A newline within a string is encoded as \n. |
| Unicode | "\u0041" | Four hexadecimal digits after \u encode a UTF-16 code unit. |
| Invalid comment | // note | JSON has no comment syntax. |
| Invalid comma | [1,2,] | A trailing comma is not allowed. |
| Invalid number | NaN | NaN and Infinity are not JSON values. |
| Leading zero | 012 | Leading zeros are not allowed in integers. |
| Root pointer | "" | Selects the entire document. |
| Escaped pointer | /a~1b | Selects the property named a/b. |