swagger-typescript-api
swagger-typescript-api copied to clipboard
Axios: array param
trafficstars
A fix is needed to convert arrays to query parameters. Now, instead of a similar
site.io/request?id=100&id=200
it is done like this
site.io/request?id[]=100&id[]=200
this could be achieved with https://github.com/ljharb/qs
you can pass this to requestParams (the last argument)
{
paramsSerializer: params =>
qs.stringify(params, { arrayFormat: 'brackets' }),
},
see more options:

Axios
I have the same problem , when use array parameters

Thanks @ApacheEx, paramsSerializer helps with that (I'm using indices in my case)
This worked for me:
{
paramsSerializer: {
indexes: null,
},
}