code - https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/http/rest.d example - https://github.com/rejectedsoftware/vibe.d/blob/master/examples/rest/source/app.d
Have you seen vibe.d REST module? It does exactly that - abuses D
reflection for REStful HTTP API generation.