Can JSON start with “[“?

From what I can read on json.org, all JSON strings should start with { (curly brace), and [ characters (square brackets) represent an array element in JSON.

I use the json4j library, and I got an input that starts with [, so I didn’t think this was valid JSON. I looked briefly at the JSON schema, but I couldn’t really find it stated that a JSON file cannot start with [, or that it can only start with {.

4 Answers
4

Leave a Comment