Re: "Plain JSON" vs Hydra

Hi Dimitri,

On 05/08/14 17:22, Dimitri van Hees wrote:
> Hi,
>
> Following some discussions here about Hypermedia API's, I'm struggling with some design decisions. First let me make something clear: I really like JSON-LD and I really like Hydra.
>
> However, in my opinion, JSON-LD is just another response format. In our API's we've dropped XML support some years ago (fortunately), and provide only JSON. Now i know that JSON-LD is basically (completely valid) JSON, but still I'd like to provide both "Plain JSON" and JSON-LD responses.
>
> That said, if someone sends the accept header application/json, I won't bother him/her with @types, external links and @context values. If someone sends the accept header application/ld+json, I return a JSON-LD document, with more than 'just' a link to a context file in the response header so that it actually makes a lot of sense to use this representation.

To make your JSON response better looking, you can:
  - Move @context to a header (as you mentioned)
  - What is the problem with "@types"? The "@" in the key? Then you can 
renamed "@types" to "types" and add an entry in the context file. The 
IRIs of the types? Then add short names in the context file. Or is it 
because this information is not interesting for the users? Personally, I 
appreciate this kind of information.

Why would you like to remove external links? Do you declare some 
instance-specific operations?

Do you have some examples of entries you would like to remove?

Best,
Benjamin

Received on Tuesday, 5 August 2014 15:56:14 UTC