Replacing `Arg(dict)` with marshmallow?
See original GitHub issueIn webargs < 0.16
, I have arguments defined as Arg(dict, ...)
. How do I convert these to marshmallow fields? The changelog shows examples with strings and nested arguments, but I couldn’t find an example with dict
.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Fields — marshmallow 3.19.0 documentation
Allows you to replace nested data with one of the data's fields. ... kwargs (dict) – Field-specific keyword arguments. Returns:.
Read more >Python Marshmallow: Dict validation Error - Stack Overflow
This is just toy data but exemplifies that the keys in the dictionaries are not fixed, they change in number and text. So...
Read more >marshmallow - Read the Docs
To customize the error message for required fields, pass a dict with a required key as the error_messages argument for the field. class...
Read more >Object validation and conversion with Marshmallow in Python
Marshmallow is a Python library that converts complex data types to and ... Note: To avoid installing packages globally, use the virtual ...
Read more >marshmallow -- simplified object serialization | We all are data.
To customize the error message for required fields, pass a dict with a required key as the error_messages argument for the field. from...
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
@stranbird That is the expected behavior;
fields.Dict
does not expect to receive strings as input, and webargs does not do any special preprocessing. One solution is to create a custom field:@sloria neat solution, ty!