JSON:
{
"name": "xxxxx",
"job": "xxxxxx",
"projects": [
{
"name": "xxxxx",
"date": "xxxxx",
"about": "xxxxxxxxxx"
},
{
"name": "xxxxx",
"date": "xxxxx",
"about": "xxxxxxxxxx"
},
{
"name": "xxxxx",
"date": "xxxxx",
"about": "xxxxxxxxxx"
}
]
}
Elisp file:
(let ((json-object-type 'hash-table)
(json-array-type 'list)
(json-key-type 'string))
(setq data (with-temp-buffer
(insert-file-contents (elt argv 0))
(buffer-string))))
How to access the first element in projects list (json array)?
Note: According to https://github.com/thorstadt/json.el/blob/master/json.el (read-json) should be used instead of setq but it doesn't show a clear example on how to do that. Also I have chosen hash-tables as the json-object-type as in comparision of plist and alist it seems favorable to me.