I've been using the REST framework for binding to a variety of services, but there's one use case that's come up repeatedly which does not seem to be supported: specifying the complete body of a request as a single parameter value in the interface.

It's often the case that one endpoint returns the exact same document structure that another expects as input. For example:

struct Details
{
  string name, description;
}

interface API
{
  Details get(string name);
  void add(Details details);
}

As far as I can see there's currently no nice way to make these methods use the same document structure. Either the Details argument for add will be wrapped in an additional details field in the Json body, or I have to duplicate the Details members as parameters for add instead of passing it as a typed struct.

Is there a clean way to do this?