[Ocs] JSON spec

Mohd Izhar Firdaus Ismail kagesenshi.87 at gmail.com
Thu Feb 9 18:21:12 PST 2012


On Fri, Feb 10, 2012 at 6:56 AM, Laszlo Papp <lpapp at kde.org> wrote:
>> 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) ?

not readily interchangeable is fine i think, as long as all data from
the xml is represented in the json.

though if ocs is choosing non-interchangeable format, there should be
a full specification on the json format so that all data is
represented. or a specification on how to transform the xml to a ocs
json ..

what i noticed disappeared in the php json is -> 'details' attribute
in <person details="full"> is lost. also. I'm not sure how the loss of
that info will affect the clients, but loss of <meta> and <ocs> should
be fine i think  ...

however if the attributes of <icon> tag in 'content' service are lost,
that should break something.  so the icon tag (and possibly some more)
JSON representation will need to be put solid in the specification.

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


-- 
Mohd Izhar Firdaus Bin Ismail / KageSenshi
Inigo Consulting (FOSS/Plone Development, Training & Services)
http://www.inigo-tech.com
Fedora Malaysia Contributor & Ambassador
http://blog.kagesenshi.org
92C2 B295 B40B B3DC 6866  5011 5BD2 584A 8A5D 7331


More information about the Ocs mailing list