vibe.web.web: Allow Json as a auto-injected parameter type#1853
vibe.web.web: Allow Json as a auto-injected parameter type#1853wilzbach wants to merge 2 commits intovibe-d:masterfrom
Conversation
|
Instead of giving That would also mean that When that works, This is of course a bit more to type and the question is if frequency wins over clarity of intent here. If it should turn out that it does, then we should at least restrict this to parameters named |
As you might have guessed, I am not a huge fan of struct MyInputObject {
string p1, p2, p3;
@optional Nullable!int i;
}
void foo(MyInputObject input)over picking out some attributes manually: @bodyParam("p1")
@bodyParam("p2")
@bodyParam("p3")
@bodyParam("i")
void (string p1, string p2, string p3, Nullable!int i = Nullable!int.init)In practice there are much more attributes, of course. void foo() {
if (auto tok = "adminToken" in req.query) {
...Whereas with
Btw currently
Well, I maintain a small fork of
Would be fine for me. |
Done (used FWIW there are already a lot of special cases: The point of this PR was that the someone has a Btw we could also - similarly to |
-> #1945 |
7039cb0 to
e44ffef
Compare
|
Rebased to trigger the CI systems.
This is the case since some time. @s-ludwig anything else blocking this? |
Split-off from #1697
Now that
req.jsonis lazy, this shouldn't be blocked anymore :)