Am 09.02.2016 um 21:52 schrieb Jacob Carlborg:

Is there a particular reason why the rest interface generator,
URLRouter.registerRestInterface, only works with interfaces?

I don't see a technical reason why just a class or a struct wouldn't
work. I'm not sure what the uses case was when this was created but to
me it just adds extra tedious work, keeping the class and interface in
sync.

The motivation is to ensure that the client and server implementations
talk over the same interface and to make it more or less impossible to
accidentally misuse it. But this issue has been brought up before and a
possible solution is to generate the interface from the class definition
in cases where it is just overhead. It would then look something like this:

class MyRestAPI : AutoInterface!MyRestInterface {
   ...
}