Possible bug for Marshmallow fields
See original GitHub issueI’ve been having trouble setting up default values for the Integer field. I tried using both load_default
and default
parameters to no avail. It still resulted in the following error message:
{
"Code": 422,
"errors": {
"query": {
"page": [
"Not a valid integer."
]
}
}
}
In the Schema, I also have a string field. As I am using webargs, I removed the user parameter from the url, and I did get an error message coming from the string field that was similar to the integer one. I’m not sure whether I did something wrong when assigning default values but if I didn’t, then there might be a potential bug with the source code for marshmallow.
Schema:
class AccountUserManagementWebArgs(Schema):
"""
account user management schema
"""
user = fields.String(required=True)
page = fields.Integer(default=1)
actions = fields.Nested(_account_user_management_webargs_nested, many=True)
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Changelog — marshmallow 3.19.0 documentation
Fix bug that raised an AttributeError when instantiating a Schema with a field named ... It makes it possible to either “include”, “exclude”,...
Read more >Method Errors Cause Missing Field #993 - GitHub
It looks like marshmallow 2.x is swallowing exceptions indiscriminately and ignoring the field. The issue does not seem to be present in ...
Read more >marshmallow - Read the Docs
marshmallow is an ORM/ODM/framework-agnostic library for converting complex datatypes, such as objects, to and from native Python datatypes. from datetime ...
Read more >top-level marshmallow schema validation - Stack Overflow
My question : Is it possible to validate at the Schema level (rather than at individual field level) and still return an error...
Read more >Toasted Marshmallow — Marshmallow but 15X Faster.
Marshmallow is slow because it's effectively implementing an interpreter in an interpreter. When you serialize an object through Marshmallow it ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I won’t dig through the whole code sample but
Could it be you parser sets
None
as default for all query args, including pagination query args and then you getNone
for page, which is invalid?(You may try to send a request with a value for page and see what happens.)
Great. Closing this, then.