@@ -64,7 +64,7 @@ describe("generateOpenApiSpec", () => {
6464
6565 const result = await generateOpenApiSpec ( schemas ) ;
6666
67- expect ( result ) . toEqual ( {
67+ expect ( result ) . toStrictEqual ( {
6868 openapi : "3.1.0" ,
6969 info : {
7070 title : "Test Service" ,
@@ -78,13 +78,11 @@ describe("generateOpenApiSpec", () => {
7878 operationId : "getUsers" ,
7979 parameters : [
8080 {
81- description : "List of the column names" ,
8281 in : "query" ,
8382 name : "select" ,
84- required : false ,
83+ required : true ,
8584 schema : {
8685 default : [ ] ,
87- description : "List of the column names" ,
8886 items : {
8987 enum : [
9088 "id" ,
@@ -96,7 +94,6 @@ describe("generateOpenApiSpec", () => {
9694 } ,
9795 } ,
9896 ] ,
99- requestBody : undefined ,
10097 responses : {
10198 200 : {
10299 content : {
@@ -112,11 +109,9 @@ describe("generateOpenApiSpec", () => {
112109 description : "Returns a list of users" ,
113110 } ,
114111 400 : {
115- content : undefined ,
116112 description : "Bad Request" ,
117113 } ,
118114 500 : {
119- content : undefined ,
120115 description : "Internal Server Error" ,
121116 } ,
122117 } ,
@@ -127,7 +122,6 @@ describe("generateOpenApiSpec", () => {
127122 post : {
128123 description : "Create a new user" ,
129124 operationId : "createUser" ,
130- parameters : undefined ,
131125 requestBody : {
132126 content : {
133127 "application/json" : {
@@ -150,11 +144,9 @@ describe("generateOpenApiSpec", () => {
150144 description : "User created successfully" ,
151145 } ,
152146 400 : {
153- content : undefined ,
154147 description : "Bad Request" ,
155148 } ,
156149 409 : {
157- content : undefined ,
158150 description : "Email already exists" ,
159151 } ,
160152 500 : {
@@ -183,6 +175,7 @@ describe("generateOpenApiSpec", () => {
183175 } ,
184176 additionalProperties : false ,
185177 required : [ "id" , "name" ] ,
178+ $schema : "https://json-schema.org/draft/2020-12/schema" ,
186179 } ,
187180 NewUserDTO : {
188181 type : "object" ,
@@ -196,6 +189,7 @@ describe("generateOpenApiSpec", () => {
196189 } ,
197190 additionalProperties : false ,
198191 required : [ "name" ] ,
192+ $schema : "https://json-schema.org/draft/2020-12/schema" ,
199193 } ,
200194 } ,
201195 } ,
@@ -249,13 +243,11 @@ describe("generateOpenApiSpec", () => {
249243 operationId : "getUsers" ,
250244 parameters : [
251245 {
252- description : "List of the column names" ,
253246 in : "query" ,
254247 name : "select" ,
255- required : false ,
248+ required : true ,
256249 schema : {
257250 default : [ ] ,
258- description : "List of the column names" ,
259251 items : {
260252 enum : [
261253 "id" ,
@@ -267,7 +259,6 @@ describe("generateOpenApiSpec", () => {
267259 } ,
268260 } ,
269261 ] ,
270- requestBody : undefined ,
271262 responses : {
272263 200 : {
273264 content : {
@@ -283,11 +274,9 @@ describe("generateOpenApiSpec", () => {
283274 description : "Returns a list of users" ,
284275 } ,
285276 400 : {
286- content : undefined ,
287277 description : "Bad Request" ,
288278 } ,
289279 500 : {
290- content : undefined ,
291280 description : "Internal Server Error" ,
292281 } ,
293282 } ,
@@ -298,7 +287,6 @@ describe("generateOpenApiSpec", () => {
298287 post : {
299288 description : "Create a new user" ,
300289 operationId : "createUser" ,
301- parameters : undefined ,
302290 requestBody : {
303291 content : {
304292 "application/json" : {
@@ -321,11 +309,9 @@ describe("generateOpenApiSpec", () => {
321309 description : "User created successfully" ,
322310 } ,
323311 400 : {
324- content : undefined ,
325312 description : "Bad Request" ,
326313 } ,
327314 409 : {
328- content : undefined ,
329315 description : "Email already exists" ,
330316 } ,
331317 500 : {
@@ -354,6 +340,7 @@ describe("generateOpenApiSpec", () => {
354340 } ,
355341 additionalProperties : false ,
356342 required : [ "id" , "name" ] ,
343+ $schema : "https://json-schema.org/draft/2020-12/schema" ,
357344 } ,
358345 NewUserDTO : {
359346 type : "object" ,
@@ -367,6 +354,7 @@ describe("generateOpenApiSpec", () => {
367354 } ,
368355 additionalProperties : false ,
369356 required : [ "name" ] ,
357+ $schema : "https://json-schema.org/draft/2020-12/schema" ,
370358 } ,
371359 } ,
372360 } ,
0 commit comments