Skip to content

Commit 2ad93b1

Browse files
committed
Remove all extraneous fields from test schema
1 parent efed10f commit 2ad93b1

File tree

1 file changed

+4
-60
lines changed

1 file changed

+4
-60
lines changed

tests/v3/index.test.ts

Lines changed: 4 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -999,54 +999,10 @@ describe("OpenAPI3 features", () => {
999999
get: {
10001000
summary: "get summary",
10011001
description: "get description",
1002-
responses: {
1003-
"200": {
1004-
content: {
1005-
"application/json": {
1006-
schema: {
1007-
type: "object",
1008-
properties: {
1009-
title: { type: "string" },
1010-
body: { type: "string" },
1011-
},
1012-
required: ["title", "body"],
1013-
},
1014-
},
1015-
},
1016-
},
1017-
},
1002+
responses: { },
10181003
},
10191004
},
1020-
},
1021-
components: {
1022-
schemas: {
1023-
ErrorResponse: {
1024-
type: "object",
1025-
properties: {
1026-
error: { type: "string" },
1027-
message: { type: "string" },
1028-
},
1029-
required: ["error", "message"],
1030-
},
1031-
SearchResponse: {
1032-
type: "object",
1033-
properties: {
1034-
title: { type: "string" },
1035-
date: { type: "string" },
1036-
},
1037-
required: ["title", "date"],
1038-
},
1039-
},
1040-
responses: {
1041-
NotFound: {
1042-
content: {
1043-
"application/json": {
1044-
schema: { $ref: "#/components/schemas/ErrorResponse" },
1045-
},
1046-
},
1047-
},
1048-
},
1049-
},
1005+
}
10501006
};
10511007

10521008
expect(swaggerToTS(schema)).toBe(
@@ -1057,26 +1013,14 @@ describe("OpenAPI3 features", () => {
10571013
* get description
10581014
*/
10591015
get: {
1060-
responses: {
1061-
'200': {
1062-
'application/json': { title: string; body: string }
1063-
}
1064-
}
1016+
responses: { }
10651017
}
10661018
};
10671019
}
10681020
10691021
export interface operations {}
10701022
1071-
export interface components {
1072-
schemas: {
1073-
ErrorResponse: { error: string; message: string };
1074-
SearchResponse: { title: string; date: string }
1075-
}
1076-
responses: {
1077-
NotFound: { [key: string]: any }
1078-
}
1079-
}`)
1023+
export interface components {}`)
10801024
);
10811025
});
10821026
});

0 commit comments

Comments
 (0)