Skip to content

Commit d7ae545

Browse files
committed
test: update snapshots to add json:api content type
1 parent feefce2 commit d7ae545

File tree

28 files changed

+538
-0
lines changed

28 files changed

+538
-0
lines changed

tests/__snapshots__/extended.test.ts.snap

+210
Large diffs are not rendered by default.

tests/__snapshots__/simple.test.ts.snap

+210
Large diffs are not rendered by default.

tests/spec/another-query-params/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ type CancelToken = Symbol | string | number;
8787
8888
export enum ContentType {
8989
Json = "application/json",
90+
JsonApi = "application/vnd.api+json",
9091
FormData = "multipart/form-data",
9192
UrlEncoded = "application/x-www-form-urlencoded",
9293
Text = "text/plain",
@@ -153,6 +154,10 @@ export class HttpClient<SecurityDataType = unknown> {
153154
input !== null && (typeof input === "object" || typeof input === "string")
154155
? JSON.stringify(input)
155156
: input,
157+
[ContentType.JsonApi]: (input: any) =>
158+
input !== null && (typeof input === "object" || typeof input === "string")
159+
? JSON.stringify(input)
160+
: input,
156161
[ContentType.Text]: (input: any) =>
157162
input !== null && typeof input !== "string"
158163
? JSON.stringify(input)

tests/spec/axios/__snapshots__/basic.test.ts.snap

+1
Original file line numberDiff line numberDiff line change
@@ -1954,6 +1954,7 @@ export interface ApiConfig<SecurityDataType = unknown>
19541954

19551955
export enum ContentType {
19561956
Json = "application/json",
1957+
JsonApi = "application/vnd.api+json",
19571958
FormData = "multipart/form-data",
19581959
UrlEncoded = "application/x-www-form-urlencoded",
19591960
Text = "text/plain",

tests/spec/axiosSingleHttpClient/__snapshots__/basic.test.ts.snap

+1
Original file line numberDiff line numberDiff line change
@@ -1954,6 +1954,7 @@ export interface ApiConfig<SecurityDataType = unknown>
19541954

19551955
export enum ContentType {
19561956
Json = "application/json",
1957+
JsonApi = "application/vnd.api+json",
19571958
FormData = "multipart/form-data",
19581959
UrlEncoded = "application/x-www-form-urlencoded",
19591960
Text = "text/plain",

tests/spec/custom-extensions/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ type CancelToken = Symbol | string | number;
5959
6060
export enum ContentType {
6161
Json = "application/json",
62+
JsonApi = "application/vnd.api+json",
6263
FormData = "multipart/form-data",
6364
UrlEncoded = "application/x-www-form-urlencoded",
6465
Text = "text/plain",
@@ -125,6 +126,10 @@ export class HttpClient<SecurityDataType = unknown> {
125126
input !== null && (typeof input === "object" || typeof input === "string")
126127
? JSON.stringify(input)
127128
: input,
129+
[ContentType.JsonApi]: (input: any) =>
130+
input !== null && (typeof input === "object" || typeof input === "string")
131+
? JSON.stringify(input)
132+
: input,
128133
[ContentType.Text]: (input: any) =>
129134
input !== null && typeof input !== "string"
130135
? JSON.stringify(input)

tests/spec/defaultAsSuccess/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ type CancelToken = Symbol | string | number;
9999
100100
export enum ContentType {
101101
Json = "application/json",
102+
JsonApi = "application/vnd.api+json",
102103
FormData = "multipart/form-data",
103104
UrlEncoded = "application/x-www-form-urlencoded",
104105
Text = "text/plain",
@@ -165,6 +166,10 @@ export class HttpClient<SecurityDataType = unknown> {
165166
input !== null && (typeof input === "object" || typeof input === "string")
166167
? JSON.stringify(input)
167168
: input,
169+
[ContentType.JsonApi]: (input: any) =>
170+
input !== null && (typeof input === "object" || typeof input === "string")
171+
? JSON.stringify(input)
172+
: input,
168173
[ContentType.Text]: (input: any) =>
169174
input !== null && typeof input !== "string"
170175
? JSON.stringify(input)

tests/spec/defaultResponse/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ type CancelToken = Symbol | string | number;
5959
6060
export enum ContentType {
6161
Json = "application/json",
62+
JsonApi = "application/vnd.api+json",
6263
FormData = "multipart/form-data",
6364
UrlEncoded = "application/x-www-form-urlencoded",
6465
Text = "text/plain",
@@ -125,6 +126,10 @@ export class HttpClient<SecurityDataType = unknown> {
125126
input !== null && (typeof input === "object" || typeof input === "string")
126127
? JSON.stringify(input)
127128
: input,
129+
[ContentType.JsonApi]: (input: any) =>
130+
input !== null && (typeof input === "object" || typeof input === "string")
131+
? JSON.stringify(input)
132+
: input,
128133
[ContentType.Text]: (input: any) =>
129134
input !== null && typeof input !== "string"
130135
? JSON.stringify(input)

tests/spec/deprecated/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ type CancelToken = Symbol | string | number;
5959
6060
export enum ContentType {
6161
Json = "application/json",
62+
JsonApi = "application/vnd.api+json",
6263
FormData = "multipart/form-data",
6364
UrlEncoded = "application/x-www-form-urlencoded",
6465
Text = "text/plain",
@@ -125,6 +126,10 @@ export class HttpClient<SecurityDataType = unknown> {
125126
input !== null && (typeof input === "object" || typeof input === "string")
126127
? JSON.stringify(input)
127128
: input,
129+
[ContentType.JsonApi]: (input: any) =>
130+
input !== null && (typeof input === "object" || typeof input === "string")
131+
? JSON.stringify(input)
132+
: input,
128133
[ContentType.Text]: (input: any) =>
129134
input !== null && typeof input !== "string"
130135
? JSON.stringify(input)

tests/spec/dot-path-params/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ type CancelToken = Symbol | string | number;
6161
6262
export enum ContentType {
6363
Json = "application/json",
64+
JsonApi = "application/vnd.api+json",
6465
FormData = "multipart/form-data",
6566
UrlEncoded = "application/x-www-form-urlencoded",
6667
Text = "text/plain",
@@ -127,6 +128,10 @@ export class HttpClient<SecurityDataType = unknown> {
127128
input !== null && (typeof input === "object" || typeof input === "string")
128129
? JSON.stringify(input)
129130
: input,
131+
[ContentType.JsonApi]: (input: any) =>
132+
input !== null && (typeof input === "object" || typeof input === "string")
133+
? JSON.stringify(input)
134+
: input,
130135
[ContentType.Text]: (input: any) =>
131136
input !== null && typeof input !== "string"
132137
? JSON.stringify(input)

tests/spec/enumNamesAsValues/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ type CancelToken = Symbol | string | number;
251251
252252
export enum ContentType {
253253
Json = "application/json",
254+
JsonApi = "application/vnd.api+json",
254255
FormData = "multipart/form-data",
255256
UrlEncoded = "application/x-www-form-urlencoded",
256257
Text = "text/plain",
@@ -317,6 +318,10 @@ export class HttpClient<SecurityDataType = unknown> {
317318
input !== null && (typeof input === "object" || typeof input === "string")
318319
? JSON.stringify(input)
319320
: input,
321+
[ContentType.JsonApi]: (input: any) =>
322+
input !== null && (typeof input === "object" || typeof input === "string")
323+
? JSON.stringify(input)
324+
: input,
320325
[ContentType.Text]: (input: any) =>
321326
input !== null && typeof input !== "string"
322327
? JSON.stringify(input)

tests/spec/enumNotFirstInComponents/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ type CancelToken = Symbol | string | number;
8989
9090
export enum ContentType {
9191
Json = "application/json",
92+
JsonApi = "application/vnd.api+json",
9293
FormData = "multipart/form-data",
9394
UrlEncoded = "application/x-www-form-urlencoded",
9495
Text = "text/plain",
@@ -155,6 +156,10 @@ export class HttpClient<SecurityDataType = unknown> {
155156
input !== null && (typeof input === "object" || typeof input === "string")
156157
? JSON.stringify(input)
157158
: input,
159+
[ContentType.JsonApi]: (input: any) =>
160+
input !== null && (typeof input === "object" || typeof input === "string")
161+
? JSON.stringify(input)
162+
: input,
158163
[ContentType.Text]: (input: any) =>
159164
input !== null && typeof input !== "string"
160165
? JSON.stringify(input)

tests/spec/extractRequestBody/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ type CancelToken = Symbol | string | number;
228228
229229
export enum ContentType {
230230
Json = "application/json",
231+
JsonApi = "application/vnd.api+json",
231232
FormData = "multipart/form-data",
232233
UrlEncoded = "application/x-www-form-urlencoded",
233234
Text = "text/plain",
@@ -294,6 +295,10 @@ export class HttpClient<SecurityDataType = unknown> {
294295
input !== null && (typeof input === "object" || typeof input === "string")
295296
? JSON.stringify(input)
296297
: input,
298+
[ContentType.JsonApi]: (input: any) =>
299+
input !== null && (typeof input === "object" || typeof input === "string")
300+
? JSON.stringify(input)
301+
: input,
297302
[ContentType.Text]: (input: any) =>
298303
input !== null && typeof input !== "string"
299304
? JSON.stringify(input)

tests/spec/extractRequestParams/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ type CancelToken = Symbol | string | number;
134134
135135
export enum ContentType {
136136
Json = "application/json",
137+
JsonApi = "application/vnd.api+json",
137138
FormData = "multipart/form-data",
138139
UrlEncoded = "application/x-www-form-urlencoded",
139140
Text = "text/plain",
@@ -200,6 +201,10 @@ export class HttpClient<SecurityDataType = unknown> {
200201
input !== null && (typeof input === "object" || typeof input === "string")
201202
? JSON.stringify(input)
202203
: input,
204+
[ContentType.JsonApi]: (input: any) =>
205+
input !== null && (typeof input === "object" || typeof input === "string")
206+
? JSON.stringify(input)
207+
: input,
203208
[ContentType.Text]: (input: any) =>
204209
input !== null && typeof input !== "string"
205210
? JSON.stringify(input)

tests/spec/extractResponseBody/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ type CancelToken = Symbol | string | number;
214214
215215
export enum ContentType {
216216
Json = "application/json",
217+
JsonApi = "application/vnd.api+json",
217218
FormData = "multipart/form-data",
218219
UrlEncoded = "application/x-www-form-urlencoded",
219220
Text = "text/plain",
@@ -280,6 +281,10 @@ export class HttpClient<SecurityDataType = unknown> {
280281
input !== null && (typeof input === "object" || typeof input === "string")
281282
? JSON.stringify(input)
282283
: input,
284+
[ContentType.JsonApi]: (input: any) =>
285+
input !== null && (typeof input === "object" || typeof input === "string")
286+
? JSON.stringify(input)
287+
: input,
283288
[ContentType.Text]: (input: any) =>
284289
input !== null && typeof input !== "string"
285290
? JSON.stringify(input)

tests/spec/extractResponseError/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ type CancelToken = Symbol | string | number;
209209
210210
export enum ContentType {
211211
Json = "application/json",
212+
JsonApi = "application/vnd.api+json",
212213
FormData = "multipart/form-data",
213214
UrlEncoded = "application/x-www-form-urlencoded",
214215
Text = "text/plain",
@@ -275,6 +276,10 @@ export class HttpClient<SecurityDataType = unknown> {
275276
input !== null && (typeof input === "object" || typeof input === "string")
276277
? JSON.stringify(input)
277278
: input,
279+
[ContentType.JsonApi]: (input: any) =>
280+
input !== null && (typeof input === "object" || typeof input === "string")
281+
? JSON.stringify(input)
282+
: input,
278283
[ContentType.Text]: (input: any) =>
279284
input !== null && typeof input !== "string"
280285
? JSON.stringify(input)

tests/spec/js/__snapshots__/basic.test.ts.snap

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import axios from "axios";
1717
export var ContentType;
1818
(function (ContentType) {
1919
ContentType["Json"] = "application/json";
20+
ContentType["JsonApi"] = "application/vnd.api+json";
2021
ContentType["FormData"] = "multipart/form-data";
2122
ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
2223
ContentType["Text"] = "text/plain";

tests/spec/jsAxios/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ exports[`basic > --js 1`] = `
1616
export var ContentType;
1717
(function (ContentType) {
1818
ContentType["Json"] = "application/json";
19+
ContentType["JsonApi"] = "application/vnd.api+json";
1920
ContentType["FormData"] = "multipart/form-data";
2021
ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
2122
ContentType["Text"] = "text/plain";
@@ -71,6 +72,10 @@ export class HttpClient {
7172
input !== null && (typeof input === "object" || typeof input === "string")
7273
? JSON.stringify(input)
7374
: input,
75+
[ContentType.JsonApi]: (input) =>
76+
input !== null && (typeof input === "object" || typeof input === "string")
77+
? JSON.stringify(input)
78+
: input,
7479
[ContentType.Text]: (input) =>
7580
input !== null && typeof input !== "string"
7681
? JSON.stringify(input)

tests/spec/moduleNameFirstTag/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ type CancelToken = Symbol | string | number;
184184
185185
export enum ContentType {
186186
Json = "application/json",
187+
JsonApi = "application/vnd.api+json",
187188
FormData = "multipart/form-data",
188189
UrlEncoded = "application/x-www-form-urlencoded",
189190
Text = "text/plain",
@@ -250,6 +251,10 @@ export class HttpClient<SecurityDataType = unknown> {
250251
input !== null && (typeof input === "object" || typeof input === "string")
251252
? JSON.stringify(input)
252253
: input,
254+
[ContentType.JsonApi]: (input: any) =>
255+
input !== null && (typeof input === "object" || typeof input === "string")
256+
? JSON.stringify(input)
257+
: input,
253258
[ContentType.Text]: (input: any) =>
254259
input !== null && typeof input !== "string"
255260
? JSON.stringify(input)

tests/spec/moduleNameIndex/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ type CancelToken = Symbol | string | number;
184184
185185
export enum ContentType {
186186
Json = "application/json",
187+
JsonApi = "application/vnd.api+json",
187188
FormData = "multipart/form-data",
188189
UrlEncoded = "application/x-www-form-urlencoded",
189190
Text = "text/plain",
@@ -250,6 +251,10 @@ export class HttpClient<SecurityDataType = unknown> {
250251
input !== null && (typeof input === "object" || typeof input === "string")
251252
? JSON.stringify(input)
252253
: input,
254+
[ContentType.JsonApi]: (input: any) =>
255+
input !== null && (typeof input === "object" || typeof input === "string")
256+
? JSON.stringify(input)
257+
: input,
253258
[ContentType.Text]: (input: any) =>
254259
input !== null && typeof input !== "string"
255260
? JSON.stringify(input)

tests/spec/on-insert-path-param/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ type CancelToken = Symbol | string | number;
5959
6060
export enum ContentType {
6161
Json = "application/json",
62+
JsonApi = "application/vnd.api+json",
6263
FormData = "multipart/form-data",
6364
UrlEncoded = "application/x-www-form-urlencoded",
6465
Text = "text/plain",
@@ -125,6 +126,10 @@ export class HttpClient<SecurityDataType = unknown> {
125126
input !== null && (typeof input === "object" || typeof input === "string")
126127
? JSON.stringify(input)
127128
: input,
129+
[ContentType.JsonApi]: (input: any) =>
130+
input !== null && (typeof input === "object" || typeof input === "string")
131+
? JSON.stringify(input)
132+
: input,
128133
[ContentType.Text]: (input: any) =>
129134
input !== null && typeof input !== "string"
130135
? JSON.stringify(input)

tests/spec/patch/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -1816,6 +1816,7 @@ type CancelToken = Symbol | string | number;
18161816

18171817
export enum ContentType {
18181818
Json = "application/json",
1819+
JsonApi = "application/vnd.api+json",
18191820
FormData = "multipart/form-data",
18201821
UrlEncoded = "application/x-www-form-urlencoded",
18211822
Text = "text/plain",
@@ -1882,6 +1883,10 @@ export class HttpClient<SecurityDataType = unknown> {
18821883
input !== null && (typeof input === "object" || typeof input === "string")
18831884
? JSON.stringify(input)
18841885
: input,
1886+
[ContentType.JsonApi]: (input: any) =>
1887+
input !== null && (typeof input === "object" || typeof input === "string")
1888+
? JSON.stringify(input)
1889+
: input,
18851890
[ContentType.Text]: (input: any) =>
18861891
input !== null && typeof input !== "string"
18871892
? JSON.stringify(input)

tests/spec/responses/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ type CancelToken = Symbol | string | number;
9999
100100
export enum ContentType {
101101
Json = "application/json",
102+
JsonApi = "application/vnd.api+json",
102103
FormData = "multipart/form-data",
103104
UrlEncoded = "application/x-www-form-urlencoded",
104105
Text = "text/plain",
@@ -165,6 +166,10 @@ export class HttpClient<SecurityDataType = unknown> {
165166
input !== null && (typeof input === "object" || typeof input === "string")
166167
? JSON.stringify(input)
167168
: input,
169+
[ContentType.JsonApi]: (input: any) =>
170+
input !== null && (typeof input === "object" || typeof input === "string")
171+
? JSON.stringify(input)
172+
: input,
168173
[ContentType.Text]: (input: any) =>
169174
input !== null && typeof input !== "string"
170175
? JSON.stringify(input)

tests/spec/singleHttpClient/__snapshots__/basic.test.ts.snap

+5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ type CancelToken = Symbol | string | number;
5959
6060
export enum ContentType {
6161
Json = "application/json",
62+
JsonApi = "application/vnd.api+json",
6263
FormData = "multipart/form-data",
6364
UrlEncoded = "application/x-www-form-urlencoded",
6465
Text = "text/plain",
@@ -125,6 +126,10 @@ export class HttpClient<SecurityDataType = unknown> {
125126
input !== null && (typeof input === "object" || typeof input === "string")
126127
? JSON.stringify(input)
127128
: input,
129+
[ContentType.JsonApi]: (input: any) =>
130+
input !== null && (typeof input === "object" || typeof input === "string")
131+
? JSON.stringify(input)
132+
: input,
128133
[ContentType.Text]: (input: any) =>
129134
input !== null && typeof input !== "string"
130135
? JSON.stringify(input)

0 commit comments

Comments
 (0)