Skip to content

Commit 8222496

Browse files
committed
Add all Referenceable objects to the subset doc
1 parent 269c1c7 commit 8222496

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/Microsoft.OpenApi/Services/OpenApiFilterService.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,42 @@ private static bool AddReferences(OpenApiComponents newComponents, OpenApiCompon
278278
moreStuff = true;
279279
target.RequestBodies.Add(item);
280280
}
281+
282+
foreach (var item in newComponents.Headers
283+
.Where(item => !target.Headers.ContainsKey(item.Key)))
284+
{
285+
moreStuff = true;
286+
target.Headers.Add(item);
287+
}
288+
289+
foreach (var item in newComponents.Links
290+
.Where(item => !target.Links.ContainsKey(item.Key)))
291+
{
292+
moreStuff = true;
293+
target.Links.Add(item);
294+
}
295+
296+
foreach (var item in newComponents.Callbacks
297+
.Where(item => !target.Callbacks.ContainsKey(item.Key)))
298+
{
299+
moreStuff = true;
300+
target.Callbacks.Add(item);
301+
}
302+
303+
foreach (var item in newComponents.Examples
304+
.Where(item => !target.Examples.ContainsKey(item.Key)))
305+
{
306+
moreStuff = true;
307+
target.Examples.Add(item);
308+
}
309+
310+
foreach (var item in newComponents.SecuritySchemes
311+
.Where(item => !target.SecuritySchemes.ContainsKey(item.Key)))
312+
{
313+
moreStuff = true;
314+
target.SecuritySchemes.Add(item);
315+
}
316+
281317
return moreStuff;
282318
}
283319

0 commit comments

Comments
 (0)