New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support delimited list parameters #66
Comments
The 1st option seems best. |
Agreed with everything you said, but the first option strikes me as a little underpowered. In most use cases, all list parameters for a given resource will be encoded in the same way (all repeated parameters, or all delimited parameters), so I still like a higher-level option--what about an argument passed to By the way, I don't particularly like delimited query parameters, but they seem to be pretty commonly used, and are even recommended by JSON-API, which is why I'd like to add support. |
Good point. I want to avoid adding a custom |
Currently, webargs supports list parameters in query strings using repeated parameters:
foo=bar&foo=baz
. But it's also a common pattern to encode lists in query strings using delimited values:foo=bar,baz
,foo=bar|baz
, etc. This is described using thecollectionFormat
in swagger: https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#fixed-fields-8. It would be helpful to expose control over the formatting of list values to support both repeated and delimited parameters.Here are a few thoughts about interfaces:
List
, likeDelimitedList
, that splits and joins on a delimiter on de/serializing.delimiter
argument toList
that has the same behavior as above.Schema.Meta
that controls de/serialization of lists:Not sure if I like any of these. What do you think @sloria?
The text was updated successfully, but these errors were encountered: