Perhaps you could do as the loop below and turn the foreach into:

```D
foreach(i, name, member; value.object)
{
    if (i)
        json.put(',');
    ...
}
```

Hope that works.