New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support bodyParam attribute without form parameter name to map the whole body to a single parameter #1549

Closed
s-ludwig opened this Issue Aug 14, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@s-ludwig
Member

s-ludwig commented Aug 14, 2016

Should be supported for the web and REST interfaces:

struct S { int foo; string bar; }
@bodyParam("s") void postFoo(S s) {}

For the web interface generator, this means that the endpoint "POST /foo" accepts two form parameters, "foo" and "bar". The REST interface generator instead expects a JSON object of the form {"foo": ..., "bar": ...}.

@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig Aug 14, 2016

Member

In particular, this means that the struct/class members are treated just like the parameters of the method usually are. The initial incarnation of this feature supports only structs/classes.

Member

s-ludwig commented Aug 14, 2016

In particular, this means that the struct/class members are treated just like the parameters of the method usually are. The initial incarnation of this feature supports only structs/classes.

@s-ludwig s-ludwig added this to the 0.7.30 milestone Aug 14, 2016

wilzbach added a commit to wilzbach/vibe.d that referenced this issue Feb 6, 2017

Fix vibe-d#1549 - Support bodyParam attribute without form parameter …
…name to map the whole body to a single parameter

wilzbach added a commit to wilzbach/vibe.d that referenced this issue Feb 6, 2017

Fix vibe-d#1549 - Support bodyParam attribute without form parameter …
…name to map the whole body to a single parameter

@s-ludwig s-ludwig closed this in 436e411 Mar 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment