From a155a0ca209fb202660168bbf0ce7efd03a2010c Mon Sep 17 00:00:00 2001 From: Maggiekimani1 Date: Fri, 30 Aug 2024 13:11:20 +0300 Subject: [PATCH 1/2] Add server info --- .../UtilityFiles/docWithReusableHeadersAndExamples.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/Microsoft.OpenApi.Hidi.Tests/UtilityFiles/docWithReusableHeadersAndExamples.yaml b/test/Microsoft.OpenApi.Hidi.Tests/UtilityFiles/docWithReusableHeadersAndExamples.yaml index 2f86d7661..3260ea430 100644 --- a/test/Microsoft.OpenApi.Hidi.Tests/UtilityFiles/docWithReusableHeadersAndExamples.yaml +++ b/test/Microsoft.OpenApi.Hidi.Tests/UtilityFiles/docWithReusableHeadersAndExamples.yaml @@ -2,6 +2,8 @@ openapi: 3.0.1 info: title: Example with Multiple Operations and Local $refs version: 1.0.0 +servers: +- url: https://api.github.com paths: /items: get: From e94ea23b7f50e42c90bc1d0ead56ba527d6f1505 Mon Sep 17 00:00:00 2001 From: Maggiekimani1 Date: Fri, 30 Aug 2024 13:12:07 +0300 Subject: [PATCH 2/2] Compare the source document's server to that of the resulting subset document for equality --- .../Services/OpenApiFilterServiceTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiFilterServiceTests.cs b/test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiFilterServiceTests.cs index ac566bf0d..f91d0db93 100644 --- a/test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiFilterServiceTests.cs +++ b/test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiFilterServiceTests.cs @@ -193,6 +193,7 @@ public void CopiesOverAllReferencedComponentsToTheSubsetDocumentCorrectly() var targetExamples = subsetOpenApiDocument.Components.Examples; // Assert + Assert.Same(doc.Servers, subsetOpenApiDocument.Servers); Assert.False(responseHeader.UnresolvedReference); Assert.False(mediaTypeExample.UnresolvedReference); Assert.Single(targetHeaders);