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

Nested Fields Usage #74

Closed
dwieeb opened this issue Oct 23, 2015 · 4 comments

Comments

@dwieeb
Copy link
Contributor

commented Oct 23, 2015

I've looked through the documentation and source code and now I just have to ask.

How do I format requests for endpoints that utilize nested fields? Can more documentation be written about nested fields than what exists currently?

@sloria

This comment has been minimized.

Copy link
Member

commented Oct 26, 2015

Nested fields are useful for validating JSON bodies in requests.

What documentation do you think should be added? I would welcome a PR adding docs.

@dwieeb

This comment has been minimized.

Copy link
Contributor Author

commented Nov 7, 2015

That's the part I didn't understand: that they can only be used with the json location.

As a side note, nesting of fields in query params and form params could be possible with a delimiter, such as when querying in MongoDB.

/people?name.first=Daniel&name.last=Imhoff for example.

Would this interest you? Or do you think that is assuming too much, as it does reserve a character in webarg names that would otherwise be acceptable.

@sloria

This comment has been minimized.

Copy link
Member

commented Nov 7, 2015

Indeed, Nested fields only make sense for JSON bodies with the default implementations because that's the only place you'll find nested data on the request.

You could, however, implement a parser that could read nested query parameters, though I do not think this functionality belongs in webargs. I know that filteralchemy (which uses webargs internally) has the concept of custom formatters for query params: https://filteralchemy.readthedocs.org/en/latest/quickstart.html#customizing-query-format .

@dwieeb

This comment has been minimized.

Copy link
Contributor Author

commented Nov 7, 2015

👍

@dwieeb dwieeb closed this Nov 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.