Fix axios query of array type in IClientAPI
This commit is contained in:
parent
58acafcc64
commit
9a5efccf0d
4 changed files with 5 additions and 3 deletions
|
@ -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<AxiosResponse>`)
|
||||
#### 2.1.0
|
||||
|
|
2
dist/codegen.js
vendored
2
dist/codegen.js
vendored
|
@ -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, ' +
|
||||
|
|
|
@ -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, ' +
|
||||
|
|
|
@ -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",
|
||||
|
|
Reference in a new issue