简体   繁体   中英

Contentful This is not valid JSON

在此处输入图像描述

I have the content model with one field as a JSON object. When I write an array inside this field I get This is not valid JSON .

在此处输入图像描述

Also in another screenshot, as you can see on Contentful Page it shows the error as mentioned above.

在此处输入图像描述

JSON does not allow a comma after the last element in an array:

Good:

 let string = '["Hello","Folks"]'; console.log(JSON.parse(string));

Bad:

 let string = '["Hello","Folks",]'; // comma after "Folks" console.log(JSON.parse(string));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM