so i have an external API that I would like to talk to using the restclientinterface system.

the POST endpoint expects a Json object like {template:2} now my problem is that sometimes the endpoint expects the object to look like this {text:"foo"}

this body object:

struct Obj
{
  @optional int template;
  @optional string text;
}

but it does not cut it because then the other parameter will still always be send and the API complains if that happens. so how am I supposed to use that same API endpoint without defining lots of dupication in the structs (of course they have many more members who are always supposed to be in there) and duplicated endpoints even though the path is always the same? For the record I tried Nullable!... already, that in fact sends them as null which the API still does not appreciate - its wants them gone entirely :D

Is there a DontSerializeWhenNull!... macro for this in Json or something along the lines? Or am I missing something?

Cheers,
Stephan