We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, when passing an array to a query string parameter it is always stringified as a list separated by commas.
It is desirable that this behavior can be configured to use another array formats, such as in the query-string npm package
For doing this, a new configuration option called queryStringArrayFormat could be added:
queryStringArrayFormat
import { Api } from "@xbyorange/mercury-api"; const myApi = new Api("/foo-url", { queryStringArrayFormat: "none" }); fooApi.query({ queryString: { foo: [1, 2, 3] } }).read(); //=> 'foo=1,2'
Available formats could be the same than in the query-string npm package:
//=> 'foo[]=1&foo[]=2&foo[]=3'
//=> 'foo[0]=1&foo[1]=2&foo[3]=3'
//=> 'foo=1,2,3'
//=> 'foo=1&foo=2&foo=3'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently, when passing an array to a query string parameter it is always stringified as a list separated by commas.
It is desirable that this behavior can be configured to use another array formats, such as in the query-string npm package
For doing this, a new configuration option called
queryStringArrayFormat
could be added:Available formats could be the same than in the query-string npm package:
The text was updated successfully, but these errors were encountered: