[Ocs] JSON spec

Laszlo Papp lpapp at kde.org
Thu Feb 9 14:56:58 PST 2012


> what i meant was:
>
> <ocs>
>   <meta>
>       <status>ok</status>
>       <message>success</message>
>   </meta>
>   <data>
>       <person details="summary">
>           <personid>user</personid>
>       </person>
>       <person details="summary">
>            <personid>user2</personid>
>       </person>
>   </data>
> </ocs>
>
> turns to
>
> {
>  'status': 'ok',
>  'message': 'success',
>  'data': [{
>     'personid': 'user'
>  },{
>     'personid': 'user2'
>  }]
> }

Answer B is that, it looks more correct since your lot of json just
looks like a json reprensation of the xml, rather than a json blob. I
am not yet entirely convinced we need to be interchangable. Not sure
about other format support plans, but if you were to output csv, would
you want to be interchangable xml->csv->json, too (so if you add more
formats that are not interchangable, at least easily) ?

One can say: Embedding the json inside an 'ocs' is vague, adding the
'meta' bit is alright, but not great.

Best Regards,
Laszlo Papp


More information about the Ocs mailing list