diff --git a/README.md b/README.md index 78c2165..3fd3c2a 100644 --- a/README.md +++ b/README.md @@ -608,6 +608,8 @@ interface Task { This tool only supports `application/json` type for request and response body. Any other type like `multipart/form` or `image/*` are **not supported** and will be ignored. ## Versions +#### 2.1.2 +- Fix axios query of array type in IClientAPI (add `{arrayFormat: 'repeat'}`) #### 2.1.1 - Fix axios type bug (`AxiosPromise` vs `Promise`) #### 2.1.0 diff --git a/dist/codegen.js b/dist/codegen.js index a620d33..11dd7b1 100644 --- a/dist/codegen.js +++ b/dist/codegen.js @@ -166,7 +166,7 @@ function codegenClientAPI(funcs, config, cp) { // axios cp.writeln('const $http = axios.create({', 1); cp.writeln('validateStatus: () => true,'); - cp.writeln('paramsSerializer: params => qStringify(params),'); + cp.writeln("paramsSerializer: params => qStringify(params, {arrayFormat: 'repeat'}),"); cp.writeln('});', -1); // function cp.writeln('\nfunction urlReplacer(url: string, ' + diff --git a/lib/codegen.ts b/lib/codegen.ts index c52ca2d..c5a5bd9 100644 --- a/lib/codegen.ts +++ b/lib/codegen.ts @@ -171,7 +171,7 @@ function codegenClientAPI(funcs: APIFuncs, config: Config, cp: CodePrinter) { // axios cp.writeln('const $http = axios.create({', 1); cp.writeln('validateStatus: () => true,'); - cp.writeln('paramsSerializer: params => qStringify(params),'); + cp.writeln(`paramsSerializer: params => qStringify(params, {arrayFormat: 'repeat'}),`); cp.writeln('});', -1); // function cp.writeln('\nfunction urlReplacer(url: string, ' + diff --git a/package.json b/package.json index 1f5de30..e83c4ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sup39/api-ts-gen", - "version": "2.1.1-rc", + "version": "2.1.2", "description": "OpenAPI code generator for TypeScript", "main": "dist/lib/index.js", "types": "dist/lib/index.d.ts",