Skip to content
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 all collectionFormats #69

Open
Deraen opened this issue Oct 15, 2015 · 0 comments
Open

Support all collectionFormats #69

Deraen opened this issue Oct 15, 2015 · 0 comments
Assignees

Comments

@Deraen
Copy link
Member

Deraen commented Oct 15, 2015

Swagger spec defines multiple ways to handle collections in string parameters (query, header, url encoded form params):
https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#parameter-object

Currently only multi format is supported. This works fine for query strings where the same property is repeated for each value: ?items=a&items=b&items=c. For this case we have coercion to coerce single item to collection when needed.

Some parameters (headers) don't support this multi format and instead the collection needs to be represented as single string with separators. For this we need an coercer that can split an string using selected separator. This coercion should only be done when needed. Probably based on Schema record. For users, the API should be something like: :header-params [items (collection [s/Str] :csv)].

Determines the format of the array if type array is used. Possible values are:
csv - comma separated values foo,bar.
ssv - space separated values foo bar.
tsv - tab separated values foo\tbar.
pipes - pipe separated values foo|bar.
multi - corresponds to multiple parameter instances instead of multiple values for a single instance foo=bar&foo=baz. This is valid only for parameters in "query" or "formData".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants