On 6/6/19 4:40 AM, Sönke Ludwig wrote:

I think what you need is Collection!I.

The example above would look something like this:

interface Item {
     // defines the chain of fixed parameters that identify a single item
     struct CollectionIndices {
         int _id;

     void get(int _id);
     void edit(int _id, ...);
     void delete(int _id, ...);

interface API {
     @property Collection!Item item();

Except this isn't REST. What I wanted to do was handle the first part of
the route, then pass the id into the second part. Basically, abstract
the subroute into its own piece. This can be useful for multiple
reasons. It appears that this isn't possible basically due to the static
assertion. It seems like an artificial limitation, and I'm looking to
learn why it isn't artificial if there is a good reason. It might be
something I would be able to add to vibe.d, but only if there isn't a
reason it would be impossible.