Skip to content
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
Milestone

Comments

@s-ludwig
Copy link
Member

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
Copy link
Member Author

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
…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
…name to map the whole body to a single parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant