File tree Expand file tree Collapse file tree 2 files changed +50
-1
lines changed
modules/openapi-generator/src/test
java/org/openapitools/codegen/utils Expand file tree Collapse file tree 2 files changed +50
-1
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ public class ModelUtilsTest {
44
44
public void testGetAllUsedSchemas () {
45
45
final OpenAPI openAPI = new OpenAPIParser ().readLocation ("src/test/resources/3_0/unusedSchemas.yaml" , null , new ParseOptions ()).getOpenAPI ();
46
46
List <String > allUsedSchemas = ModelUtils .getAllUsedSchemas (openAPI );
47
- Assert .assertEquals (allUsedSchemas .size (), 30 );
47
+ Assert .assertEquals (allUsedSchemas .size (), 32 );
48
48
49
49
Assert .assertTrue (allUsedSchemas .contains ("SomeObjShared" ), "contains 'SomeObjShared'" );
50
50
Assert .assertTrue (allUsedSchemas .contains ("SomeObj1" ), "contains 'UnusedObj1'" );
@@ -76,6 +76,8 @@ public void testGetAllUsedSchemas() {
76
76
Assert .assertTrue (allUsedSchemas .contains ("OtherObj20" ), "contains 'OtherObj20'" );
77
77
Assert .assertTrue (allUsedSchemas .contains ("PingDataInput21" ), "contains 'PingDataInput21'" );
78
78
Assert .assertTrue (allUsedSchemas .contains ("PingDataOutput21" ), "contains 'PingDataOutput21'" );
79
+ Assert .assertTrue (allUsedSchemas .contains ("SInput22" ), "contains 'SInput22'" );
80
+ Assert .assertTrue (allUsedSchemas .contains ("SOutput22" ), "contains 'SInput22'" );
79
81
}
80
82
81
83
@ Test
Original file line number Diff line number Diff line change @@ -263,6 +263,23 @@ paths:
263
263
application/json :
264
264
schema :
265
265
$ref : ' #/components/schemas/PingDataOutput21'
266
+ /some/p22 :
267
+ post :
268
+ operationId : op22
269
+ parameters :
270
+ - name : callbackUrl
271
+ in : query
272
+ required : true
273
+ schema :
274
+ type : string
275
+ format : uri
276
+ example : https://some-server.com
277
+ responses :
278
+ ' 201 ' :
279
+ description : OK
280
+ callbacks :
281
+ sharedCallback :
282
+ $ref : " #/components/callbacks/sharedCallback22"
266
283
components :
267
284
schemas :
268
285
UnusedObj1 :
@@ -507,6 +524,20 @@ components:
507
524
type : integer
508
525
reply :
509
526
type : String
527
+ SInput22 :
528
+ type : object
529
+ properties :
530
+ uuid :
531
+ type : String
532
+ request :
533
+ type : String
534
+ SOutput22 :
535
+ type : object
536
+ properties :
537
+ uuid :
538
+ type : String
539
+ response :
540
+ type : String
510
541
SomeObjShared :
511
542
type : object
512
543
properties :
@@ -560,4 +591,20 @@ components:
560
591
in : query
561
592
schema :
562
593
$ref : ' #/components/schemas/SomeObj11'
594
+ callbacks :
595
+ sharedCallback22 :
596
+ ' {$request.query.callbackUrl}/shared ' :
597
+ post :
598
+ requestBody :
599
+ content :
600
+ application/json :
601
+ schema :
602
+ $ref : ' #/components/schemas/SInput22'
603
+ responses :
604
+ ' 200 ' :
605
+ description : Ok
606
+ content :
607
+ application/json :
608
+ schema :
609
+ $ref : ' #/components/schemas/SOutput22'
563
610
You can’t perform that action at this time.
0 commit comments