question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't respect defaults

See original GitHub issue

As of 0.16, webargs doesn’t respect default values for missing fields:

@use_kwargs({'foo': fields.Str(default='bar')}
def view(foo):
    ...

If foo isn’t found in the request, it should default to “bar”, but it actually defaults to marshmallow.missing. It looks like we used to check for missing in Parser.parse_arg and return the default value if available, so we could restore that behavior to fix. Does that seem like the right approach @sloria? I can give this a try, or use another approach. Or you can fix it for me 🎸

Tested with Flask.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jmcarpcommented, Sep 30, 2015

Meh. Can I not pass missing as None? Seems to raise an error.

0reactions
jmcarpcommented, Oct 1, 2015

Like!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is respect earned, or must we by default respect some people?
There is the most basic respect that everyone should have for each other which doesn't require any work to earn it. That is...
Read more >
Outlook doesn't respect default with Exchange-Account
Outlook doesn't respect default with Exchange-Account. Hey Community,. I have multiple mail accounts (IMAP and Exchange) set up in Outlook.
Read more >
QueryFieldAttribute doesn't respect the default value set for ...
Describe the bug. If a parameter is set as optional on the controller method and it's missing in the query string of a...
Read more >
How to fix iTerm when it doesn't respect a custom default shell ...
On MacOS Monterey I've installed bash 5 with brew, installed in /opt/homebrew/bin/brew . Now I want to make this the default login shell,...
Read more >
LOAD DATA INFILE doesn't respect default values for columns
1. Create a table having at least one column defined as INT NOT NULL DEFAULT k (where k is nonzero). (test case: defvaluetest.sql)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found