JSON Structure for List of Objects

前端 未结 3 412
一个人的身影
一个人的身影 2020-12-24 04:50

I would like to know, whats the right structure for a list of objects in JSON.

We are using JAXB to convert the POJO\'s to JSON.

Here is the choices, Please

3条回答
  •  心在旅途
    2020-12-24 05:14

    The first one is invalid syntax. You cannot have object properties inside a plain array. The second one is right although it is not strict JSON. It's a relaxed form of JSON wherein quotes in string keys are omitted.

    This tutorial by Patrick Hunlock, may help to learn about JSON and this site may help to validate JSON.

提交回复
热议问题