Re: Operation with request body hint

Hi Tomasz

>I think it would be necessary to allow providing a complete or partial body 
>for a request. There are two possible scenarios here:
>1. The server instructs the client what the actual payload is. Period.
So why it would need the payload to start with? If the payload is fixed, 
don't bother the client with it and have an operation that doesn't expect 
any body from the client - server will know it already.

>2. The server gives the initial representation, so that the client can fill 
>the UI with default values
Well, smells like IriTemplate or MVC-like solution.
I achieve this with a complete data model description that is used to build 
a UI form that is mapped to the underlying model which is a resource created 
from scratch with "defaults" relative to it's respective properties (or 
their ranges).

I feel that IriTemplate may still be usable on simple cases (I'm not sure on 
how to apply it to the body though), but in a more advanced situation I'd 
stick with those MVC approaches.
That's why I stated that Hydra needs more generic approach when it come 
describing what an operation expects or returns. I can imagine that 
operation returns i.e. text/mustache and expects a processed form as 
text/turtle (while it sounds crazy, it seems doable).

Best

Karol

Received on Monday, 14 March 2016 19:26:35 UTC