Improve documentation on fields.DelimitedList vs fields.List
See original GitHub issueThe docs for the fields.DelimitedList say it “can load from either a list or a delimited string” but I cannot get it to load from a list. It's possible I'm doing something wrong
but When I swap out fields.DelimitedList
for fields.List
everything works as expected. I think either the docs should be changed, or we should fix the implementation of DelimitedList
so that it works as expected.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Source code for webargs.fields
"""Field classes. Includes all fields from `marshmallow.fields` in addition to a custom `Nested` field and `DelimitedList`. All fields can optionally take a ...
Read more >webargs - Read the Docs
If a List field is used to parse data from a location like query parameters – where one or multiple values can be...
Read more >webargs(1) - Arch manual pages
Parsing Lists in Query Strings. Use fields.DelimitedList to parse comma-separated lists in query parameters, e.g. /?permissions=read,write. from webargs import ...
Read more >How to work with search results - Azure Cognitive Search
On a query request, append $select=<field list> to specify which fields ... words and reduce words to root forms, which usually improves the ......
Read more >Commands - OpenSearch documentation
fields. Use the fields command to keep or remove fields from a search result. ... field list, Specify a comma-delimited list of fields....
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
5.4.0 removes the duck typing . I also added more docs re: parsing lists in query strings: https://webargs.readthedocs.io/en/latest/quickstart.html#parsing-lists-in-query-strings .
Conceptually,
DelimitedList
is aList
, evidenced by the fact that you can’t implementDelimitedList
as a non-subclass ofList
without duplicating a bunch ofList
’s code. I suppose you could use composition, but that’s not clearly better design in this context.Yeah…I don’t recall why we decided to use duck-typing here. At the very least, it hurts readability. At worst, it leads to unexpected behavior like you ran into. I’ll change this.