Hi,
I am trying to use the autogenerated api, but it crashes, if I try to use paths with parameters. Here is my code:
interface IRESTApi
{
@method(HTTPMethod.GET)
@path("/status/:item/")
@property Json status(string item);
}
...
auto router = new URLRouter();
router.registerRestInterface(cast(IRESTApi)this);
this references a class implementing a Json status(string item) method
Now, when I open in browser the page http://127.0.0.1:8080/status/environment/, I get this output with LogLevel.trace:
route match: /status/environment/ -> GET /status/:item/ ["environment"]
query item of DictionaryList!(string, true, 16u)([Field(0, "", ""), Field(0, "",
""), Field(0, "", ""), Field(0, "", ""), Field(0, "", ""), Field(0, "", ""), Fi
eld(0, "", ""), Field(0, "", ""), Field(0, "", ""), Field(0, "", ""), Field(0, "
", ""), Field(0, "", ""), Field(0, "", ""), Field(0, "", ""), Field(0, "", ""),
Field(0, "", "")], 0, [])
Problem is that this is the last thing I see. Then it simply crashes somewhere in kernel after calling std@stdio@File@LockingTextWriter@__dtor.
If I use method without parameter, it works like a charm. But when I try to use parameters, it just blows up :-/
Any ideas, what is wrong?
Thanks,
Drasha