@@ -504,31 +504,51 @@ internal IOpenApiReferenceable ResolveReference(OpenApiReference reference, bool
504
504
switch ( reference . Type )
505
505
{
506
506
case ReferenceType . Schema :
507
- return this . Components . Schemas [ reference . Id ] ;
507
+ var resolvedSchema = this . Components . Schemas [ reference . Id ] ;
508
+ resolvedSchema . Description = reference . Description != null ? reference . Description : resolvedSchema . Description ;
509
+ return resolvedSchema ;
508
510
509
511
case ReferenceType . PathItem :
510
- return this . Components . PathItems [ reference . Id ] ;
512
+ var resolvedPathItem = this . Components . PathItems [ reference . Id ] ;
513
+ resolvedPathItem . Description = reference . Description != null ? reference . Description : resolvedPathItem . Description ;
514
+ resolvedPathItem . Summary = reference . Summary != null ? reference . Summary : resolvedPathItem . Summary ;
515
+ return resolvedPathItem ;
511
516
512
517
case ReferenceType . Response :
513
- return this . Components . Responses [ reference . Id ] ;
518
+ var resolvedResponse = this . Components . Responses [ reference . Id ] ;
519
+ resolvedResponse . Description = reference . Description != null ? reference . Description : resolvedResponse . Description ;
520
+ return resolvedResponse ;
514
521
515
522
case ReferenceType . Parameter :
516
- return this . Components . Parameters [ reference . Id ] ;
523
+ var resolvedParameter = this . Components . Parameters [ reference . Id ] ;
524
+ resolvedParameter . Description = reference . Description != null ? reference . Description : resolvedParameter . Description ;
525
+ return resolvedParameter ;
517
526
518
527
case ReferenceType . Example :
519
- return this . Components . Examples [ reference . Id ] ;
528
+ var resolvedExample = this . Components . Examples [ reference . Id ] ;
529
+ resolvedExample . Summary = reference . Summary != null ? reference . Summary : resolvedExample . Summary ;
530
+ resolvedExample . Description = reference . Description != null ? reference . Description : resolvedExample . Description ;
531
+ return resolvedExample ;
520
532
521
533
case ReferenceType . RequestBody :
522
- return this . Components . RequestBodies [ reference . Id ] ;
523
-
534
+ var resolvedRequestBody = this . Components . RequestBodies [ reference . Id ] ;
535
+ resolvedRequestBody . Description = reference . Description != null ? reference . Description : resolvedRequestBody . Description ;
536
+ return resolvedRequestBody ;
537
+
524
538
case ReferenceType . Header :
525
- return this . Components . Headers [ reference . Id ] ;
526
-
539
+ var resolvedHeader = this . Components . Headers [ reference . Id ] ;
540
+ resolvedHeader . Description = reference . Description != null ? reference . Description : resolvedHeader . Description ;
541
+ return resolvedHeader ;
542
+
527
543
case ReferenceType . SecurityScheme :
528
- return this . Components . SecuritySchemes [ reference . Id ] ;
529
-
544
+ var resolvedSecurityScheme = this . Components . SecuritySchemes [ reference . Id ] ;
545
+ resolvedSecurityScheme . Description = reference . Description != null ? reference . Description : resolvedSecurityScheme . Description ;
546
+ return resolvedSecurityScheme ;
547
+
530
548
case ReferenceType . Link :
531
- return this . Components . Links [ reference . Id ] ;
549
+ var resolvedLink = this . Components . Links [ reference . Id ] ;
550
+ resolvedLink . Description = reference . Description != null ? reference . Description : resolvedLink . Description ;
551
+ return resolvedLink ;
532
552
533
553
case ReferenceType . Callback :
534
554
return this . Components . Callbacks [ reference . Id ] ;
0 commit comments