Skip to content

Commit

Permalink
disable axios automatic JSON parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
myssto committed Nov 19, 2024
1 parent fce3fc9 commit f3dc787
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/clients/ts/client-extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ export abstract class OtrApiWrapperBase {

constructor(configuration: IOtrApiWrapperConfiguration) {
this.configuration = configuration;
this.configuration.clientConfiguration = {
transitional: {
forcedJSONParsing: false,
silentJSONParsing: false
},
...this.configuration.clientConfiguration
};
}

protected getBaseUrl(..._: any[]): string { return this.configuration.baseUrl }
Expand Down
7 changes: 7 additions & 0 deletions src/clients/ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ export abstract class OtrApiWrapperBase {

constructor(configuration: IOtrApiWrapperConfiguration) {
this.configuration = configuration;
this.configuration.clientConfiguration = {
transitional: {
forcedJSONParsing: false,
silentJSONParsing: false
},
...this.configuration.clientConfiguration
};
}

protected getBaseUrl(..._: any[]): string { return this.configuration.baseUrl }
Expand Down
2 changes: 1 addition & 1 deletion src/clients/ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@osu-tournament-rating/otr-api-client",
"version": "0.0.10",
"version": "0.0.11",
"description": "Client code for interacting with the o!TR API",
"files": [
"index.js",
Expand Down

0 comments on commit f3dc787

Please sign in to comment.