Message325641
This is intentional, the parsed in JSON doesn't necessarily have to have an object at the root. This is also what allows you to do:
>>> json.loads("[]")
[]
This behavior is also consistent with browsers, try this in your browser's dev console:
> JSON.parse("123")
123
> JSON.parse('"123"')
"123"
> JSON.parse('[]')
[]
More technically, look at the JSON standard here: https://www.json.org/
As you can see, the root value is an "element", which is of type "value" surrounded by some whitespace. Values can be any of these:
value
object
array
string
number
"true"
"false"
"null" |
|
Date |
User |
Action |
Args |
2018-09-18 13:26:54 | ammar2 | set | recipients:
+ ammar2, jaihong |
2018-09-18 13:26:54 | ammar2 | set | messageid: <1537277214.23.0.956365154283.issue34721@psf.upfronthosting.co.za> |
2018-09-18 13:26:54 | ammar2 | link | issue34721 messages |
2018-09-18 13:26:54 | ammar2 | create | |
|