Skip to content

Commit

Permalink
Allow null indexes on formSerializer and paramsSerializer v0.x (#4961)
Browse files Browse the repository at this point in the history
* test: Failed test

Param indexes from formSerializer and paramsSerializer receiving null

Closes #4959

* fix: Allow null to indexes in SerializerOptions

Closes #4959

Co-authored-by: Willian Agostini <willian.agostini@fleetcor.com.br>
Co-authored-by: Jay <jasonsaayman@gmail.com>
  • Loading branch information
3 people committed Sep 29, 2022
1 parent 1e2679f commit c4bf0a4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export interface SerializerOptions {
visitor?: SerializerVisitor;
dots?: boolean;
metaTokens?: boolean;
indexes?: boolean;
indexes?: boolean | null;
}

// tslint:disable-next-line
Expand Down
11 changes: 11 additions & 0 deletions test/typescript/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,17 @@ instance1.defaults.timeout = 2500;

axios.create({ headers: { foo: 'bar' } });
axios.create({ headers: { common: { foo: 'bar' } } });
axios.create({
headers: {
'Content-Type': 'application/json',
},
formSerializer: {
indexes: null,
},
paramsSerializer: {
indexes: null,
},
});

// Interceptors

Expand Down

0 comments on commit c4bf0a4

Please sign in to comment.