MapAdapter.build
does not flatten list value from plain dict
#2307
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It should be possible to pass a list value to a custom URL converter when building. However, after some other changes to the code to support
MultiDict
, a regression was introduced that made that difficult.This changes the behavior so flattening single-item lists only happens when passing
MultiDict
, where values will always be lists, and are mainly coming fromrequest.args
where this behavior makes sense. For plain dicts, neither of these things are done, it is assumed that the user will intentionally pass a list or single item depending on what's appropriate.Additionally,
build
no longer filtersNone
items from list values. Either the list will be passed to a URL converter, where it's the converter's job to handle the value passed to it, or it's a query arg, andurl_encode
already filters outNone
.fixes #2249
continues #2261