Skip to content

Commit 2080e95

Browse files
author
Jochen Diekenbrock
committed
fix: update more test files
1 parent 1ca0670 commit 2080e95

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

tests/spec/another-query-params/expected.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export enum ContentType {
7979
Json = "application/json",
8080
FormData = "multipart/form-data",
8181
UrlEncoded = "application/x-www-form-urlencoded",
82+
Text = "text/plain",
8283
}
8384

8485
export class HttpClient<SecurityDataType = unknown> {
@@ -133,6 +134,7 @@ export class HttpClient<SecurityDataType = unknown> {
133134
private contentFormatters: Record<ContentType, (input: any) => any> = {
134135
[ContentType.Json]: (input: any) =>
135136
input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
137+
[ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input),
136138
[ContentType.FormData]: (input: any) =>
137139
Object.keys(input || {}).reduce((formData, key) => {
138140
const property = input[key];

tests/spec/another-query-params/schema.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export enum ContentType {
7979
Json = "application/json",
8080
FormData = "multipart/form-data",
8181
UrlEncoded = "application/x-www-form-urlencoded",
82+
Text = "text/plain",
8283
}
8384

8485
export class HttpClient<SecurityDataType = unknown> {
@@ -133,6 +134,7 @@ export class HttpClient<SecurityDataType = unknown> {
133134
private contentFormatters: Record<ContentType, (input: any) => any> = {
134135
[ContentType.Json]: (input: any) =>
135136
input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
137+
[ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input),
136138
[ContentType.FormData]: (input: any) =>
137139
Object.keys(input || {}).reduce((formData, key) => {
138140
const property = input[key];

0 commit comments

Comments
 (0)