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

default not working with nested args #46

Closed
Lemmons opened this issue May 29, 2015 · 0 comments

Comments

@Lemmons
Copy link

commented May 29, 2015

Nested args aren't respecting the default keyword.

For example:

@use_args({
    "param1": Arg(str, required=True, target="json"),
    "param2": Arg(str, required=False, default='bar', target="json"),
})

Behaves as expected. When making a request with the payload{"param1": "foo"}, param2 is correctly added with the value "bar".

On the other hand, with this:

@use_args({
    "param": Arg({
        "sub_param1": Arg(str, required=True, target="json"),
        "sub_param2": Arg(str, required=False, default='bar', target="json"),
    }),
})

making a request {"param": {"sub_param1": "foo"} } does not add sub_param2.

Without looking to the code too much, my guess would be this has the same root cause as #39 and #40.

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.