@@ -111,10 +111,11 @@ public OpenAPI traverseOpenApi(OpenAPI openAPI, ReferenceVisitor visitor) {
111
111
if (visiting .contains (openAPI )) {
112
112
return openAPI ;
113
113
}
114
- visiting .add (openAPI );
115
114
if (visitedMap .containsKey (openAPI )) {
116
115
return (OpenAPI )visitedMap .get (openAPI );
117
116
}
117
+ visiting .add (openAPI );
118
+
118
119
OpenAPI resolved = visitor .visitOpenApi (openAPI );
119
120
120
121
if (resolved == null ) {
@@ -150,11 +151,11 @@ public Components traverseComponents(Components components, ReferenceVisitor vis
150
151
if (visiting .contains (components )) {
151
152
return components ;
152
153
}
153
- visiting . add ( components );
154
+
154
155
if (visitedMap .containsKey (components )) {
155
156
return (Components )visitedMap .get (components );
156
157
}
157
-
158
+ visiting . add ( components );
158
159
Components resolved = visitor .visitComponents (components );
159
160
if (resolved == null ) {
160
161
resolved = components ;
@@ -183,11 +184,11 @@ public Paths traversePaths(Paths paths, ReferenceVisitor visitor) {
183
184
if (visiting .contains (paths )) {
184
185
return paths ;
185
186
}
186
- visiting . add ( paths );
187
+
187
188
if (visitedMap .containsKey (paths )) {
188
189
return (Paths )visitedMap .get (paths );
189
190
}
190
-
191
+ visiting . add ( paths );
191
192
Paths resolved = visitor .visitPaths (paths );
192
193
if (resolved == null ) {
193
194
resolved = paths ;
@@ -206,11 +207,11 @@ public Operation traverseOperation(Operation operation, ReferenceVisitor visitor
206
207
if (visiting .contains (operation )) {
207
208
return operation ;
208
209
}
209
- visiting . add ( operation );
210
+
210
211
if (visitedMap .containsKey (operation )) {
211
212
return (Operation )visitedMap .get (operation );
212
213
}
213
-
214
+ visiting . add ( operation );
214
215
Operation resolved = visitor .visitOperation (operation );
215
216
if (resolved == null ) {
216
217
resolved = operation ;
@@ -257,10 +258,11 @@ public ApiResponses traverseResponses(ApiResponses responses, ReferenceVisitor v
257
258
if (visiting .contains (responses )) {
258
259
return responses ;
259
260
}
260
- visiting . add ( responses );
261
+
261
262
if (visitedMap .containsKey (responses )) {
262
263
return (ApiResponses )visitedMap .get (responses );
263
264
}
265
+ visiting .add (responses );
264
266
ApiResponses resolved = visitor .visitResponses (responses );
265
267
if (resolved == null ) {
266
268
resolved = responses ;
@@ -279,10 +281,11 @@ public ApiResponse traverseResponse(ApiResponse response, ReferenceVisitor visit
279
281
if (visiting .contains (response )) {
280
282
return response ;
281
283
}
282
- visiting . add ( response );
284
+
283
285
if (visitedMap .containsKey (response )) {
284
286
return (ApiResponse )visitedMap .get (response );
285
287
}
288
+ visiting .add (response );
286
289
ApiResponse resolved = visitor .visitResponse (response );
287
290
288
291
boolean resolvedNotNull = false ;
@@ -326,10 +329,11 @@ public RequestBody traverseRequestBody(RequestBody requestBody, ReferenceVisitor
326
329
if (visiting .contains (requestBody )) {
327
330
return requestBody ;
328
331
}
329
- visiting . add ( requestBody );
332
+
330
333
if (visitedMap .containsKey (requestBody )) {
331
334
return (RequestBody )visitedMap .get (requestBody );
332
335
}
336
+ visiting .add (requestBody );
333
337
RequestBody resolved = visitor .visitRequestBody (requestBody );
334
338
boolean resolvedNotNull = false ;
335
339
@@ -371,11 +375,11 @@ public PathItem traversePathItem(PathItem pathItem, ReferenceVisitor visitor) {
371
375
if (visiting .contains (pathItem )) {
372
376
return pathItem ;
373
377
}
374
- visiting . add ( pathItem );
378
+
375
379
if (visitedMap .containsKey (pathItem )) {
376
380
return (PathItem ) visitedMap .get (pathItem );
377
381
}
378
-
382
+ visiting . add ( pathItem );
379
383
PathItem resolved = visitor .visitPathItem (pathItem );
380
384
381
385
boolean resolvedNotNull = false ;
@@ -472,10 +476,11 @@ public Parameter traverseParameter(Parameter parameter, ReferenceVisitor visitor
472
476
if (visiting .contains (parameter )) {
473
477
return parameter ;
474
478
}
475
- visiting . add ( parameter );
479
+
476
480
if (visitedMap .containsKey (parameter )) {
477
481
return (Parameter )visitedMap .get (parameter );
478
482
}
483
+ visiting .add (parameter );
479
484
Parameter resolved = visitor .visitParameter (parameter );
480
485
481
486
boolean resolvedNotNull = false ;
@@ -521,10 +526,11 @@ public Example traverseExample(Example example, ReferenceVisitor visitor) {
521
526
if (visiting .contains (example )) {
522
527
return example ;
523
528
}
524
- visiting . add ( example );
529
+
525
530
if (visitedMap .containsKey (example )) {
526
531
return (Example )visitedMap .get (example );
527
532
}
533
+ visiting .add (example );
528
534
Example resolved = visitor .visitExample (example );
529
535
530
536
boolean resolvedNotNull = false ;
@@ -564,10 +570,11 @@ public Callback traverseCallback(Callback callback, ReferenceVisitor visitor) {
564
570
if (visiting .contains (callback )) {
565
571
return callback ;
566
572
}
567
- visiting . add ( callback );
573
+
568
574
if (visitedMap .containsKey (callback )) {
569
575
return (Callback )visitedMap .get (callback );
570
576
}
577
+ visiting .add (callback );
571
578
traverseMap (callback , visitor , this ::traversePathItem );
572
579
visitedMap .put (callback , callback );
573
580
visiting .remove (callback );
@@ -581,11 +588,11 @@ public MediaType traverseMediaType(MediaType mediaType, ReferenceVisitor visitor
581
588
if (visiting .contains (mediaType )) {
582
589
return mediaType ;
583
590
}
584
- visiting . add ( mediaType );
591
+
585
592
if (visitedMap .containsKey (mediaType )) {
586
593
return (MediaType )visitedMap .get (mediaType );
587
594
}
588
-
595
+ visiting . add ( mediaType );
589
596
MediaType resolved = visitor .visitMediaType (mediaType );
590
597
591
598
if (resolved == null ) {
@@ -612,10 +619,11 @@ public Encoding traverseEncoding(Encoding encoding, ReferenceVisitor visitor) {
612
619
if (visiting .contains (encoding )) {
613
620
return encoding ;
614
621
}
615
- visiting . add ( encoding );
622
+
616
623
if (visitedMap .containsKey (encoding )) {
617
624
return (Encoding )visitedMap .get (encoding );
618
625
}
626
+ visiting .add (encoding );
619
627
Encoding resolved = visitor .visitEncoding (encoding );
620
628
621
629
if (resolved == null ) {
@@ -635,10 +643,11 @@ public Header traverseHeader(Header header, ReferenceVisitor visitor) {
635
643
if (visiting .contains (header )) {
636
644
return header ;
637
645
}
638
- visiting . add ( header );
646
+
639
647
if (visitedMap .containsKey (header )) {
640
648
return (Header )visitedMap .get (header );
641
649
}
650
+ visiting .add (header );
642
651
Header resolved = visitor .visitHeader (header );
643
652
644
653
boolean resolvedNotNull = false ;
@@ -684,10 +693,11 @@ public SecurityScheme traverseSecurityScheme(SecurityScheme securityScheme, Refe
684
693
if (visiting .contains (securityScheme )) {
685
694
return securityScheme ;
686
695
}
687
- visiting . add ( securityScheme );
696
+
688
697
if (visitedMap .containsKey (securityScheme )) {
689
698
return (SecurityScheme )visitedMap .get (securityScheme );
690
699
}
700
+ visiting .add (securityScheme );
691
701
SecurityScheme resolved = visitor .visitSecurityScheme (securityScheme );
692
702
boolean resolvedNotNull = false ;
693
703
@@ -725,10 +735,11 @@ public Link traverseLink(Link link, ReferenceVisitor visitor) {
725
735
if (visiting .contains (link )) {
726
736
return link ;
727
737
}
728
- visiting . add ( link );
738
+
729
739
if (visitedMap .containsKey (link )) {
730
740
return (Link )visitedMap .get (link );
731
741
}
742
+ visiting .add (link );
732
743
Link resolved = visitor .visitLink (link );
733
744
734
745
boolean resolvedNotNull = false ;
@@ -768,10 +779,11 @@ public Schema traverseSchema(Schema schema, ReferenceVisitor visitor, List<Strin
768
779
if (visiting .contains (schema )) {
769
780
return schema ;
770
781
}
771
- visiting .add (schema );
772
782
if (visitedMap .containsKey (schema )) {
773
783
return (Schema )visitedMap .get (schema );
774
784
}
785
+ visiting .add (schema );
786
+
775
787
if (StringUtils .isNotBlank (schema .get$id ())) {
776
788
inheritedIds .add (schema .get$id ());
777
789
}
0 commit comments