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

Allow empty collections #70

Closed
mTatcher opened this issue Oct 13, 2015 · 2 comments

Comments

@mTatcher
Copy link

commented Oct 13, 2015

When a fields.List is being parsed, it returns 'missing' if list is empty. Why not return empty list instead?

@mTatcher

This comment has been minimized.

Copy link
Author

commented Oct 14, 2015

In core.py, parse_arg:

if (is_multiple(field) and not
    (isinstance(value, collections.Iterable) and len(value))):

len(value) is checking if value is an empty list.
I suggest removing this check

@sloria

This comment has been minimized.

Copy link
Member

commented Oct 14, 2015

@mTatcher Yes, I think and empty list should be returned if an empty list is passed from the client. That incorrect check appears to be a remnant from webargs' pre-marshmallow days.

Pull requests welcome!

@sloria sloria closed this in 545c525 Oct 16, 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.