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 args aren't filtered when extra parameters provided #28

Closed
dgilland opened this issue Dec 9, 2014 · 2 comments

Comments

@dgilland
Copy link

commented Dec 9, 2014

When defining nested args, extra parameters aren't removed from the resulting parsed object.

For example, given the following args:

nested_args = {
    'level1': Arg({
        'level2': Arg()
    })
}

If the incoming parameters are something like:

incoming = {
    'level1': {
        'level2': 'ok',
        'extra': 'not ok'
    }
}

then the resulting parse is incoming, but I would expect it to be:

expected = {
    'level1': {
        'level2': 'ok'
    }
}
@sloria

This comment has been minimized.

Copy link
Member

commented Dec 10, 2014

Yes, the current behavior is expected, but on second thought, it may not be desired.

I think your intuition is correct. I'm wondering if we should even raise an error if extra arguments are passed in. That way, the developer user can respond to the extra arguments if appropriate.

Thoughts?

@dgilland

This comment has been minimized.

Copy link
Author

commented Dec 10, 2014

Personally, I don't need an exception raised on extra nested parameters. No exceptions are raised when extra parameters are provided to flat args. I mainly just want to only allow certain parameters in while keeping out everything else.

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.