Skip to content

Commit

Permalink
Add all Referenceable objects to the subset doc
Browse files Browse the repository at this point in the history
  • Loading branch information
MaggieKimani1 committed Aug 30, 2024
1 parent 269c1c7 commit 8222496
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/Microsoft.OpenApi/Services/OpenApiFilterService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,42 @@ private static bool AddReferences(OpenApiComponents newComponents, OpenApiCompon
moreStuff = true;
target.RequestBodies.Add(item);
}

foreach (var item in newComponents.Headers
.Where(item => !target.Headers.ContainsKey(item.Key)))
{
moreStuff = true;
target.Headers.Add(item);
}

foreach (var item in newComponents.Links
.Where(item => !target.Links.ContainsKey(item.Key)))
{
moreStuff = true;
target.Links.Add(item);
}

foreach (var item in newComponents.Callbacks
.Where(item => !target.Callbacks.ContainsKey(item.Key)))
{
moreStuff = true;
target.Callbacks.Add(item);
}

foreach (var item in newComponents.Examples
.Where(item => !target.Examples.ContainsKey(item.Key)))
{
moreStuff = true;
target.Examples.Add(item);
}

foreach (var item in newComponents.SecuritySchemes
.Where(item => !target.SecuritySchemes.ContainsKey(item.Key)))
{
moreStuff = true;
target.SecuritySchemes.Add(item);
}

return moreStuff;
}

Expand Down

0 comments on commit 8222496

Please sign in to comment.