diff --git a/Microsoft.OpenApi.sln b/Microsoft.OpenApi.sln
index a39756a42..aa64dc5be 100644
--- a/Microsoft.OpenApi.sln
+++ b/Microsoft.OpenApi.sln
@@ -14,7 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.OpenApi.Workbench", "src\Microsoft.OpenApi.Workbench\Microsoft.OpenApi.Workbench.csproj", "{6A5E91E5-0441-46EE-AEB9-8334981B7F08}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.OpenApi.Readers", "src\Microsoft.OpenApi.Readers\Microsoft.OpenApi.Readers.csproj", "{79933258-0126-4382-8755-D50820ECC483}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.OpenApi.YamlReader", "src\Microsoft.OpenApi.YamlReader\Microsoft.OpenApi.YamlReader.csproj", "{79933258-0126-4382-8755-D50820ECC483}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.OpenApi.Tests", "test\Microsoft.OpenApi.Tests\Microsoft.OpenApi.Tests.csproj", "{AD83F991-DBF3-4251-8613-9CC54C826964}"
EndProject
diff --git a/src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj b/src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj
index 2b0582db7..47ef0b906 100644
--- a/src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj
+++ b/src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj
@@ -49,7 +49,7 @@
-
+
diff --git a/src/Microsoft.OpenApi.Hidi/OpenApiService.cs b/src/Microsoft.OpenApi.Hidi/OpenApiService.cs
index 7dfb5d797..5afdbeb46 100644
--- a/src/Microsoft.OpenApi.Hidi/OpenApiService.cs
+++ b/src/Microsoft.OpenApi.Hidi/OpenApiService.cs
@@ -30,9 +30,9 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.OData;
using Microsoft.OpenApi.Reader;
-using Microsoft.OpenApi.Readers;
using Microsoft.OpenApi.Services;
using Microsoft.OpenApi.Writers;
+using Microsoft.OpenApi.YamlReader;
using static Microsoft.OpenApi.Hidi.OpenApiSpecVersionHelper;
namespace Microsoft.OpenApi.Hidi
diff --git a/src/Microsoft.OpenApi.Workbench/MainModel.cs b/src/Microsoft.OpenApi.Workbench/MainModel.cs
index d518645a5..65f8e1ba5 100644
--- a/src/Microsoft.OpenApi.Workbench/MainModel.cs
+++ b/src/Microsoft.OpenApi.Workbench/MainModel.cs
@@ -11,7 +11,7 @@
using Microsoft.OpenApi.Extensions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
-using Microsoft.OpenApi.Readers;
+using Microsoft.OpenApi.YamlReader;
using Microsoft.OpenApi.Services;
using Microsoft.OpenApi.Validations;
diff --git a/src/Microsoft.OpenApi.Workbench/Microsoft.OpenApi.Workbench.csproj b/src/Microsoft.OpenApi.Workbench/Microsoft.OpenApi.Workbench.csproj
index 3210463df..660a7b9dd 100644
--- a/src/Microsoft.OpenApi.Workbench/Microsoft.OpenApi.Workbench.csproj
+++ b/src/Microsoft.OpenApi.Workbench/Microsoft.OpenApi.Workbench.csproj
@@ -20,7 +20,7 @@
-
+
diff --git a/src/Microsoft.OpenApi.Readers/Microsoft.OpenApi.Readers.csproj b/src/Microsoft.OpenApi.YamlReader/Microsoft.OpenApi.YamlReader.csproj
similarity index 100%
rename from src/Microsoft.OpenApi.Readers/Microsoft.OpenApi.Readers.csproj
rename to src/Microsoft.OpenApi.YamlReader/Microsoft.OpenApi.YamlReader.csproj
diff --git a/src/Microsoft.OpenApi.Readers/OpenApiYamlReader.cs b/src/Microsoft.OpenApi.YamlReader/OpenApiYamlReader.cs
similarity index 98%
rename from src/Microsoft.OpenApi.Readers/OpenApiYamlReader.cs
rename to src/Microsoft.OpenApi.YamlReader/OpenApiYamlReader.cs
index cff6dd1da..65b8dcba5 100644
--- a/src/Microsoft.OpenApi.Readers/OpenApiYamlReader.cs
+++ b/src/Microsoft.OpenApi.YamlReader/OpenApiYamlReader.cs
@@ -12,7 +12,7 @@
using System.Linq;
using Microsoft.OpenApi.Models;
-namespace Microsoft.OpenApi.Readers
+namespace Microsoft.OpenApi.YamlReader
{
///
/// Reader for parsing YAML files into an OpenAPI document.
diff --git a/src/Microsoft.OpenApi.Readers/Properties/AssemblyInfo.cs b/src/Microsoft.OpenApi.YamlReader/Properties/AssemblyInfo.cs
similarity index 100%
rename from src/Microsoft.OpenApi.Readers/Properties/AssemblyInfo.cs
rename to src/Microsoft.OpenApi.YamlReader/Properties/AssemblyInfo.cs
diff --git a/src/Microsoft.OpenApi.Readers/Properties/SRResource.Designer.cs b/src/Microsoft.OpenApi.YamlReader/Properties/SRResource.Designer.cs
similarity index 100%
rename from src/Microsoft.OpenApi.Readers/Properties/SRResource.Designer.cs
rename to src/Microsoft.OpenApi.YamlReader/Properties/SRResource.Designer.cs
diff --git a/src/Microsoft.OpenApi.Readers/Properties/SRResource.resx b/src/Microsoft.OpenApi.YamlReader/Properties/SRResource.resx
similarity index 100%
rename from src/Microsoft.OpenApi.Readers/Properties/SRResource.resx
rename to src/Microsoft.OpenApi.YamlReader/Properties/SRResource.resx
diff --git a/src/Microsoft.OpenApi.Readers/YamlConverter.cs b/src/Microsoft.OpenApi.YamlReader/YamlConverter.cs
similarity index 99%
rename from src/Microsoft.OpenApi.Readers/YamlConverter.cs
rename to src/Microsoft.OpenApi.YamlReader/YamlConverter.cs
index 7d338ffa1..e2fc5f434 100644
--- a/src/Microsoft.OpenApi.Readers/YamlConverter.cs
+++ b/src/Microsoft.OpenApi.YamlReader/YamlConverter.cs
@@ -6,7 +6,7 @@
using SharpYaml;
using SharpYaml.Serialization;
-namespace Microsoft.OpenApi.Reader
+namespace Microsoft.OpenApi.YamlReader
{
///
/// Provides extensions to convert YAML models to JSON models.
diff --git a/test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiFilterServiceTests.cs b/test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiFilterServiceTests.cs
index 3bd9efd2a..61eec5e6a 100644
--- a/test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiFilterServiceTests.cs
+++ b/test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiFilterServiceTests.cs
@@ -3,11 +3,9 @@
using Microsoft.Extensions.Logging;
using Microsoft.OpenApi.Models;
-using Microsoft.OpenApi.Readers;
using Microsoft.OpenApi.Services;
using Microsoft.OpenApi.Tests.UtilityFiles;
using Moq;
-using SharpYaml.Tokens;
using Xunit;
namespace Microsoft.OpenApi.Hidi.Tests
diff --git a/test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiServiceTests.cs b/test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiServiceTests.cs
index 798b7532e..3387b96b5 100644
--- a/test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiServiceTests.cs
+++ b/test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiServiceTests.cs
@@ -12,8 +12,8 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.OData;
using Microsoft.OpenApi.Reader;
-using Microsoft.OpenApi.Readers;
using Microsoft.OpenApi.Services;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Hidi.Tests
@@ -335,7 +335,7 @@ public async Task InvokeShowCommandAsync()
var openApi = Path.Combine(".", "UtilityFiles", "SampleOpenApi.yml");
var args = new[] { "show", "-d", openApi, "-o", "sample.md" };
var parseResult = rootCommand.Parse(args);
- var handler = rootCommand.Subcommands.Where(c => c.Name == "show").First().Handler;
+ var handler = rootCommand.Subcommands.First(c => c.Name == "show").Handler;
var context = new InvocationContext(parseResult);
await handler!.InvokeAsync(context);
@@ -351,7 +351,7 @@ public async Task InvokePluginCommandAsync()
var manifest = Path.Combine(".", "UtilityFiles", "exampleapimanifest.json");
var args = new[] { "plugin", "-m", manifest, "--of", AppDomain.CurrentDomain.BaseDirectory };
var parseResult = rootCommand.Parse(args);
- var handler = rootCommand.Subcommands.Where(c => c.Name == "plugin").First().Handler;
+ var handler = rootCommand.Subcommands.First(c => c.Name == "plugin").Handler;
var context = new InvocationContext(parseResult);
await handler!.InvokeAsync(context);
diff --git a/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj b/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj
index eeac984a0..a9b8fedd6 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj
+++ b/test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj
@@ -27,8 +27,9 @@
+
-
+
diff --git a/test/Microsoft.OpenApi.Readers.Tests/OpenApiReaderTests/OpenApiDiagnosticTests.cs b/test/Microsoft.OpenApi.Readers.Tests/OpenApiReaderTests/OpenApiDiagnosticTests.cs
index 5ecd58071..3e4a4a4ad 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/OpenApiReaderTests/OpenApiDiagnosticTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/OpenApiReaderTests/OpenApiDiagnosticTests.cs
@@ -5,12 +5,12 @@
using System.Threading.Tasks;
using System;
using FluentAssertions;
-using Microsoft.OpenApi.Exceptions;
using Microsoft.OpenApi.Models;
using Xunit;
using System.IO;
using Microsoft.OpenApi.Interfaces;
using Microsoft.OpenApi.Reader;
+using Microsoft.OpenApi.YamlReader;
namespace Microsoft.OpenApi.Readers.Tests.OpenApiReaderTests
{
diff --git a/test/Microsoft.OpenApi.Readers.Tests/OpenApiReaderTests/OpenApiStreamReaderTests.cs b/test/Microsoft.OpenApi.Readers.Tests/OpenApiReaderTests/OpenApiStreamReaderTests.cs
index 82a410946..66beff944 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/OpenApiReaderTests/OpenApiStreamReaderTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/OpenApiReaderTests/OpenApiStreamReaderTests.cs
@@ -7,6 +7,7 @@
using System.Threading.Tasks;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.OpenApiReaderTests
@@ -48,7 +49,7 @@ public async Task StreamShouldNotBeDisposedIfLeaveStreamOpenSettingIsTrueAsync()
memoryStream.Position = 0;
var stream = memoryStream;
- var result = OpenApiDocument.Load(stream, "yaml", new OpenApiReaderSettings { LeaveStreamOpen = true });
+ _ = await OpenApiDocument.LoadAsync(stream, "yaml", new OpenApiReaderSettings { LeaveStreamOpen = true });
stream.Seek(0, SeekOrigin.Begin); // does not throw an object disposed exception
Assert.True(stream.CanRead);
}
@@ -64,7 +65,7 @@ public async Task StreamShouldReadWhenInitializedAsync()
var stream = await httpClient.GetStreamAsync("20fe7a7b720a0e48e5842d002ac418b12a8201df/tests/v3.0/pass/petstore.yaml");
// Read V3 as YAML
- var result = OpenApiDocument.Load(stream, "yaml");
+ var result = await OpenApiDocument.LoadAsync(stream, "yaml");
Assert.NotNull(result.OpenApiDocument);
}
}
diff --git a/test/Microsoft.OpenApi.Readers.Tests/OpenApiWorkspaceTests/OpenApiWorkspaceStreamTests.cs b/test/Microsoft.OpenApi.Readers.Tests/OpenApiWorkspaceTests/OpenApiWorkspaceStreamTests.cs
index 4aca9b54e..b10376c26 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/OpenApiWorkspaceTests/OpenApiWorkspaceStreamTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/OpenApiWorkspaceTests/OpenApiWorkspaceStreamTests.cs
@@ -1,17 +1,16 @@
-using System;
+using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.OpenApi.Interfaces;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.OpenApiWorkspaceTests
{
public class OpenApiWorkspaceStreamTests
- {
- private const string SampleFolderPath = "V3Tests/Samples/OpenApiWorkspace/";
-
+ {
public OpenApiWorkspaceStreamTests()
{
OpenApiReaderRegistry.RegisterReader(OpenApiConstants.Yaml, new OpenApiYamlReader());
diff --git a/test/Microsoft.OpenApi.Readers.Tests/ParseNodeTests.cs b/test/Microsoft.OpenApi.Readers.Tests/ParseNodeTests.cs
index 3f7c669b0..b7e2704b2 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/ParseNodeTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/ParseNodeTests.cs
@@ -6,7 +6,7 @@
using Microsoft.OpenApi.Exceptions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
-using Microsoft.OpenApi.Readers;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Tests
diff --git a/test/Microsoft.OpenApi.Readers.Tests/ReferenceService/TryLoadReferenceV2Tests.cs b/test/Microsoft.OpenApi.Readers.Tests/ReferenceService/TryLoadReferenceV2Tests.cs
index d6fb3b8ba..074ccde22 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/ReferenceService/TryLoadReferenceV2Tests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/ReferenceService/TryLoadReferenceV2Tests.cs
@@ -7,6 +7,7 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
using Microsoft.OpenApi.Reader;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.ReferenceService
diff --git a/test/Microsoft.OpenApi.Readers.Tests/TestCustomExtension.cs b/test/Microsoft.OpenApi.Readers.Tests/TestCustomExtension.cs
index 9d7727aae..8b971c976 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/TestCustomExtension.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/TestCustomExtension.cs
@@ -7,6 +7,7 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
using Microsoft.OpenApi.Writers;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests
@@ -39,7 +40,6 @@ public void ParseCustomExtension()
};
OpenApiReaderRegistry.RegisterReader("yaml", new OpenApiYamlReader());
- var diag = new OpenApiDiagnostic();
var actual = OpenApiDocument.Parse(description, "yaml", settings: settings);
var fooExtension = actual.OpenApiDocument.Info.Extensions["x-foo"] as FooExtension;
diff --git a/test/Microsoft.OpenApi.Readers.Tests/TestHelper.cs b/test/Microsoft.OpenApi.Readers.Tests/TestHelper.cs
index f8b222c36..32ee4d53c 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/TestHelper.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/TestHelper.cs
@@ -2,20 +2,20 @@
// Licensed under the MIT license.
using System.IO;
-using System.Linq;
using Microsoft.OpenApi.Reader;
using Microsoft.OpenApi.Reader.ParseNodes;
+using Microsoft.OpenApi.YamlReader;
using SharpYaml.Serialization;
namespace Microsoft.OpenApi.Readers.Tests
{
- internal class TestHelper
+ internal static class TestHelper
{
public static MapNode CreateYamlMapNode(Stream stream)
{
var yamlStream = new YamlStream();
yamlStream.Load(new StreamReader(stream));
- var yamlNode = yamlStream.Documents.First().RootNode;
+ var yamlNode = yamlStream.Documents[0].RootNode;
var context = new ParsingContext(new OpenApiDiagnostic());
var asJsonNode = yamlNode.ToJsonNode();
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/ComparisonTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/ComparisonTests.cs
index b3e30c672..08a4381a0 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/ComparisonTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/ComparisonTests.cs
@@ -1,10 +1,11 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System.IO;
using FluentAssertions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.V2Tests
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiDocumentTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiDocumentTests.cs
index 596269644..0249fc673 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiDocumentTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiDocumentTests.cs
@@ -12,6 +12,7 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
using Microsoft.OpenApi.Reader;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.V2Tests
@@ -329,8 +330,7 @@ public void ParseDocumentWithDefaultContentTypeSettingShouldSucceed()
public void testContentType()
{
var contentType = "application/json; charset = utf-8";
- var res = contentType.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).First();
- var expected = res.Split('/').LastOrDefault();
+ var res = contentType.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)[0];
Assert.Equal("application/json", res);
}
}
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiSecuritySchemeTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiSecuritySchemeTests.cs
index 82565facd..c30d47c7a 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiSecuritySchemeTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiSecuritySchemeTests.cs
@@ -9,6 +9,7 @@
using Microsoft.OpenApi.Reader;
using Microsoft.OpenApi.Reader.ParseNodes;
using Microsoft.OpenApi.Reader.V2;
+using Microsoft.OpenApi.YamlReader;
using SharpYaml.Serialization;
using Xunit;
@@ -216,7 +217,7 @@ static YamlDocument LoadYamlDocument(Stream input)
using var reader = new StreamReader(input);
var yamlStream = new YamlStream();
yamlStream.Load(reader);
- return yamlStream.Documents.First();
+ return yamlStream.Documents[0];
}
}
}
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiServerTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiServerTests.cs
index 2e5779adb..45dac5817 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiServerTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiServerTests.cs
@@ -2,6 +2,7 @@
using FluentAssertions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.V2Tests
@@ -62,7 +63,7 @@ public void JustHostNoDefault()
""";
var result = OpenApiDocument.Parse(input, "yaml");
- var server = result.OpenApiDocument.Servers.First();
+ var server = result.OpenApiDocument.Servers[0];
Assert.Single(result.OpenApiDocument.Servers);
Assert.Equal("//www.foo.com", server.Url);
}
@@ -87,7 +88,7 @@ public void NoBasePath()
};
var result = OpenApiDocument.Parse(input, "yaml", settings);
- var server = result.OpenApiDocument.Servers.First();
+ var server = result.OpenApiDocument.Servers[0];
Assert.Single(result.OpenApiDocument.Servers);
Assert.Equal("http://www.foo.com", server.Url);
}
@@ -106,7 +107,7 @@ public void JustBasePathNoDefault()
""";
var result = OpenApiDocument.Parse(input, "yaml");
- var server = result.OpenApiDocument.Servers.First();
+ var server = result.OpenApiDocument.Servers[0];
Assert.Single(result.OpenApiDocument.Servers);
Assert.Equal("/baz", server.Url);
}
@@ -131,7 +132,7 @@ public void JustSchemeWithCustomHost()
var result = OpenApiDocument.Parse(input, "yaml", settings);
- var server = result.OpenApiDocument.Servers.First();
+ var server = result.OpenApiDocument.Servers[0];
Assert.Single(result.OpenApiDocument.Servers);
Assert.Equal("http://bing.com/foo", server.Url);
}
@@ -156,7 +157,7 @@ public void JustSchemeWithCustomHostWithEmptyPath()
var result = OpenApiDocument.Parse(input, "yaml", settings);
- var server = result.OpenApiDocument.Servers.First();
+ var server = result.OpenApiDocument.Servers[0];
Assert.Single(result.OpenApiDocument.Servers);
Assert.Equal("http://bing.com", server.Url);
}
@@ -180,7 +181,7 @@ public void JustBasePathWithCustomHost()
var result = OpenApiDocument.Parse(input, "yaml", settings);
- var server = result.OpenApiDocument.Servers.First();
+ var server = result.OpenApiDocument.Servers[0];
Assert.Single(result.OpenApiDocument.Servers);
Assert.Equal("https://bing.com/api", server.Url);
}
@@ -204,7 +205,7 @@ public void JustHostWithCustomHost()
var result = OpenApiDocument.Parse(input, "yaml", settings);
- var server = result.OpenApiDocument.Servers.First();
+ var server = result.OpenApiDocument.Servers[0];
Assert.Single(result.OpenApiDocument.Servers);
Assert.Equal("https://www.example.com", server.Url);
}
@@ -228,7 +229,7 @@ public void JustHostWithCustomHostWithApi()
};
var result = OpenApiDocument.Parse(input, "yaml", settings);
- var server = result.OpenApiDocument.Servers.First();
+ var server = result.OpenApiDocument.Servers[0];
Assert.Single(result.OpenApiDocument.Servers);
Assert.Equal("https://prod.bing.com", server.Url);
}
@@ -254,7 +255,7 @@ public void MultipleServers()
};
var result = OpenApiDocument.Parse(input, "yaml", settings);
- var server = result.OpenApiDocument.Servers.First();
+ var server = result.OpenApiDocument.Servers[0];
Assert.Equal(2, result.OpenApiDocument.Servers.Count);
Assert.Equal("http://dev.bing.com/api", server.Url);
Assert.Equal("https://dev.bing.com/api", result.OpenApiDocument.Servers.Last().Url);
@@ -280,7 +281,7 @@ public void LocalHostWithCustomHost()
var result = OpenApiDocument.Parse(input, "yaml", settings);
- var server = result.OpenApiDocument.Servers.First();
+ var server = result.OpenApiDocument.Servers[0];
Assert.Single(result.OpenApiDocument.Servers);
Assert.Equal("https://localhost:23232", server.Url);
}
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiDocumentTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiDocumentTests.cs
index 638d69667..ecb331c2e 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiDocumentTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiDocumentTests.cs
@@ -9,10 +9,9 @@
using Microsoft.OpenApi.Reader;
using Microsoft.OpenApi.Tests;
using Microsoft.OpenApi.Writers;
-using Microsoft.OpenApi.Services;
using Xunit;
-using System.Linq;
using VerifyXunit;
+using Microsoft.OpenApi.YamlReader;
namespace Microsoft.OpenApi.Readers.Tests.V31Tests
{
@@ -397,7 +396,6 @@ public void ParseDocumentsWithReusablePathItemInWebhooksSucceeds()
var outputWriter = new StringWriter(CultureInfo.InvariantCulture);
var writer = new OpenApiJsonWriter(outputWriter, new() { InlineLocalReferences = true });
actual.OpenApiDocument.SerializeAsV31(writer);
- var serialized = outputWriter.ToString();
}
[Fact]
@@ -523,9 +521,9 @@ public async Task ParseExternalDocumentDereferenceToOpenApiDocumentByIdWorks()
// Act
var result = await OpenApiDocument.LoadAsync(Path.Combine(SampleFolderPath, "externalRefById.yaml"), settings);
- var doc2 = OpenApiDocument.Load(Path.Combine(SampleFolderPath, "externalResource.yaml")).OpenApiDocument;
+ var doc2 = (await OpenApiDocument.LoadAsync(Path.Combine(SampleFolderPath, "externalResource.yaml"))).OpenApiDocument;
- var requestBodySchema = result.OpenApiDocument.Paths["/resource"].Operations[OperationType.Get].Parameters.First().Schema;
+ var requestBodySchema = result.OpenApiDocument.Paths["/resource"].Operations[OperationType.Get].Parameters[0].Schema;
result.OpenApiDocument.Workspace.RegisterComponents(doc2);
// Assert
@@ -536,10 +534,10 @@ public async Task ParseExternalDocumentDereferenceToOpenApiDocumentByIdWorks()
public async Task ParseDocumentWith31PropertiesWorks()
{
var path = Path.Combine(SampleFolderPath, "documentWith31Properties.yaml");
- var doc = OpenApiDocument.Load(path).OpenApiDocument;
+ var doc = (await OpenApiDocument.LoadAsync(path)).OpenApiDocument;
var outputStringWriter = new StringWriter();
doc.SerializeAsV31(new OpenApiYamlWriter(outputStringWriter));
- outputStringWriter.Flush();
+ await outputStringWriter.FlushAsync();
var actual = outputStringWriter.GetStringBuilder().ToString();
// Assert
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiInfoTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiInfoTests.cs
index 8ecfcf7d5..dbacc76b6 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiInfoTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiInfoTests.cs
@@ -6,6 +6,7 @@
using Microsoft.OpenApi.Reader;
using Microsoft.OpenApi.Reader.ParseNodes;
using Microsoft.OpenApi.Reader.V31;
+using Microsoft.OpenApi.YamlReader;
using SharpYaml.Serialization;
using Xunit;
@@ -21,7 +22,7 @@ public void ParseBasicInfoShouldSucceed()
using var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "basicInfo.yaml"));
var yamlStream = new YamlStream();
yamlStream.Load(new StreamReader(stream));
- var yamlNode = yamlStream.Documents.First().RootNode;
+ var yamlNode = yamlStream.Documents[0].RootNode;
var diagnostic = new OpenApiDiagnostic();
var context = new ParsingContext(diagnostic);
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiLicenseTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiLicenseTests.cs
index cb617064e..16aefbb7a 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiLicenseTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiLicenseTests.cs
@@ -8,6 +8,7 @@
using Microsoft.OpenApi.Reader;
using Microsoft.OpenApi.Reader.ParseNodes;
using Microsoft.OpenApi.Reader.V31;
+using Microsoft.OpenApi.YamlReader;
using SharpYaml.Serialization;
using Xunit;
@@ -24,7 +25,7 @@ public void ParseLicenseWithSpdxIdentifierShouldSucceed()
using var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "licenseWithSpdxIdentifier.yaml"));
var yamlStream = new YamlStream();
yamlStream.Load(new StreamReader(stream));
- var yamlNode = yamlStream.Documents.First().RootNode;
+ var yamlNode = yamlStream.Documents[0].RootNode;
var diagnostic = new OpenApiDiagnostic();
var context = new ParsingContext(diagnostic);
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiSchemaTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiSchemaTests.cs
index 967bb0f3e..e23e87895 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiSchemaTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiSchemaTests.cs
@@ -10,6 +10,7 @@
using Microsoft.OpenApi.Reader;
using Microsoft.OpenApi.Tests;
using Microsoft.OpenApi.Writers;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.V31Tests
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiCallbackTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiCallbackTests.cs
index cab621c14..166d7e173 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiCallbackTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiCallbackTests.cs
@@ -7,6 +7,7 @@
using Microsoft.OpenApi.Expressions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.V3Tests
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiDiscriminatorTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiDiscriminatorTests.cs
index 6556ade48..769ec72ab 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiDiscriminatorTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiDiscriminatorTests.cs
@@ -5,6 +5,7 @@
using FluentAssertions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.V3Tests
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiDocumentTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiDocumentTests.cs
index 1382d0248..02d475464 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiDocumentTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiDocumentTests.cs
@@ -16,7 +16,7 @@
using Microsoft.OpenApi.Validations;
using Microsoft.OpenApi.Validations.Rules;
using Microsoft.OpenApi.Writers;
-using SharpYaml.Model;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.V3Tests
@@ -1118,7 +1118,7 @@ public void GlobalSecurityRequirementShouldReferenceSecurityScheme()
{
var result = OpenApiDocument.Load(System.IO.Path.Combine(SampleFolderPath, "securedApi.yaml"));
- var securityRequirement = result.OpenApiDocument.SecurityRequirements.First();
+ var securityRequirement = result.OpenApiDocument.SecurityRequirements[0];
securityRequirement.Keys.First().Should().BeEquivalentTo(result.OpenApiDocument.Components.SecuritySchemes.First().Value,
options => options.Excluding(x => x.Reference));
@@ -1331,10 +1331,9 @@ public void ParseDocWithRefsUsingProxyReferencesSucceeds()
// Act
var doc = OpenApiDocument.Load(stream, "yaml").OpenApiDocument;
- var actualParam = doc.Paths["/pets"].Operations[OperationType.Get].Parameters.First();
+ var actualParam = doc.Paths["/pets"].Operations[OperationType.Get].Parameters[0];
var outputDoc = doc.SerializeAsYaml(OpenApiSpecVersion.OpenApi3_0).MakeLineBreaksEnvironmentNeutral();
- var output = actualParam.SerializeAsYaml(OpenApiSpecVersion.OpenApi3_0);
- var expectedParam = expected.Paths["/pets"].Operations[OperationType.Get].Parameters.First();
+ var expectedParam = expected.Paths["/pets"].Operations[OperationType.Get].Parameters[0];
// Assert
actualParam.Should().BeEquivalentTo(expectedParam, options => options
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiEncodingTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiEncodingTests.cs
index eaf802d8c..e323d5205 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiEncodingTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiEncodingTests.cs
@@ -5,6 +5,7 @@
using FluentAssertions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.V3Tests
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiExampleTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiExampleTests.cs
index 84f028f6b..249b45e91 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiExampleTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiExampleTests.cs
@@ -7,6 +7,7 @@
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.V3Tests
@@ -62,9 +63,6 @@ public void ParseAdvancedExampleShouldSucceed()
}
};
- var actualRoot = example.Value["versions"][0]["status"].Root;
- var expectedRoot = expected.Value["versions"][0]["status"].Root;
-
diagnostic.Errors.Should().BeEmpty();
example.Should().BeEquivalentTo(expected, options => options.IgnoringCyclicReferences()
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiInfoTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiInfoTests.cs
index 2fa75cf60..b18b72480 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiInfoTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiInfoTests.cs
@@ -8,6 +8,7 @@
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.V3Tests
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiMediaTypeTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiMediaTypeTests.cs
index 26de35edb..10075ba84 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiMediaTypeTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiMediaTypeTests.cs
@@ -8,6 +8,7 @@
using Microsoft.OpenApi.Reader;
using Microsoft.OpenApi.Reader.ParseNodes;
using Microsoft.OpenApi.Reader.V3;
+using Microsoft.OpenApi.YamlReader;
using Microsoft.OpenApi.Tests;
using Xunit;
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiOperationTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiOperationTests.cs
index 9ba96bbda..c5ce3c31c 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiOperationTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiOperationTests.cs
@@ -7,6 +7,7 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
using Microsoft.OpenApi.Reader;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.V3Tests
@@ -25,7 +26,7 @@ public void OperationWithSecurityRequirementShouldReferenceSecurityScheme()
{
var result = OpenApiDocument.Load(Path.Combine(SampleFolderPath, "securedOperation.yaml"));
- var securityScheme = result.OpenApiDocument.Paths["/"].Operations[OperationType.Get].Security.First().Keys.First();
+ var securityScheme = result.OpenApiDocument.Paths["/"].Operations[OperationType.Get].Security[0].Keys.First();
securityScheme.Should().BeEquivalentTo(result.OpenApiDocument.Components.SecuritySchemes.First().Value,
options => options.Excluding(x => x.Reference));
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiParameterTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiParameterTests.cs
index e0f6460aa..0f44fde8b 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiParameterTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiParameterTests.cs
@@ -2,15 +2,13 @@
// Licensed under the MIT license.
using System.Collections.Generic;
-using System;
using System.IO;
using FluentAssertions;
-using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
using Xunit;
using Microsoft.OpenApi.Reader.V3;
-using Microsoft.OpenApi.Services;
+using Microsoft.OpenApi.YamlReader;
namespace Microsoft.OpenApi.Readers.Tests.V3Tests
{
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiResponseTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiResponseTests.cs
index 09a1d00a1..7bffc466b 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiResponseTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiResponseTests.cs
@@ -6,6 +6,7 @@
using FluentAssertions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.V3Tests
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiSchemaTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiSchemaTests.cs
index 81cb4376b..ad85d9f09 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiSchemaTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiSchemaTests.cs
@@ -16,6 +16,7 @@
using Microsoft.OpenApi.Reader.V3;
using FluentAssertions.Equivalency;
using Microsoft.OpenApi.Models.References;
+using Microsoft.OpenApi.YamlReader;
namespace Microsoft.OpenApi.Readers.Tests.V3Tests
{
@@ -35,7 +36,7 @@ public void ParsePrimitiveSchemaShouldSucceed()
using var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "primitiveSchema.yaml"));
var yamlStream = new YamlStream();
yamlStream.Load(new StreamReader(stream));
- var yamlNode = yamlStream.Documents.First().RootNode;
+ var yamlNode = yamlStream.Documents[0].RootNode;
var diagnostic = new OpenApiDiagnostic();
var context = new ParsingContext(diagnostic);
@@ -65,10 +66,9 @@ public void ParseExampleStringFragmentShouldSucceed()
""foo"": ""bar"",
""baz"": [ 1,2]
}";
- var diagnostic = new OpenApiDiagnostic();
// Act
- var openApiAny = OpenApiModelFactory.Parse(input, OpenApiSpecVersion.OpenApi3_0, out diagnostic);
+ var openApiAny = OpenApiModelFactory.Parse(input, OpenApiSpecVersion.OpenApi3_0, out var diagnostic);
// Assert
diagnostic.Should().BeEquivalentTo(new OpenApiDiagnostic());
@@ -89,10 +89,9 @@ public void ParseEnumFragmentShouldSucceed()
""foo"",
""baz""
]";
- var diagnostic = new OpenApiDiagnostic();
// Act
- var openApiAny = OpenApiModelFactory.Parse(input, OpenApiSpecVersion.OpenApi3_0, out diagnostic);
+ var openApiAny = OpenApiModelFactory.Parse(input, OpenApiSpecVersion.OpenApi3_0, out var diagnostic);
// Assert
diagnostic.Should().BeEquivalentTo(new OpenApiDiagnostic());
@@ -115,10 +114,9 @@ public void ParsePathFragmentShouldSucceed()
'200':
description: Ok
";
- var diagnostic = new OpenApiDiagnostic();
// Act
- var openApiAny = OpenApiModelFactory.Parse(input, OpenApiSpecVersion.OpenApi3_0, out diagnostic, "yaml");
+ var openApiAny = OpenApiModelFactory.Parse(input, OpenApiSpecVersion.OpenApi3_0, out var diagnostic, "yaml");
// Assert
diagnostic.Should().BeEquivalentTo(new OpenApiDiagnostic());
@@ -150,7 +148,7 @@ public void ParseDictionarySchemaShouldSucceed()
{
var yamlStream = new YamlStream();
yamlStream.Load(new StreamReader(stream));
- var yamlNode = yamlStream.Documents.First().RootNode;
+ var yamlNode = yamlStream.Documents[0].RootNode;
var diagnostic = new OpenApiDiagnostic();
var context = new ParsingContext(diagnostic);
@@ -182,7 +180,7 @@ public void ParseBasicSchemaWithExampleShouldSucceed()
using var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "basicSchemaWithExample.yaml"));
var yamlStream = new YamlStream();
yamlStream.Load(new StreamReader(stream));
- var yamlNode = yamlStream.Documents.First().RootNode;
+ var yamlNode = yamlStream.Documents[0].RootNode;
var diagnostic = new OpenApiDiagnostic();
var context = new ParsingContext(diagnostic);
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiSecuritySchemeTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiSecuritySchemeTests.cs
index ef1aa0fdb..b2b8d05c0 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiSecuritySchemeTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiSecuritySchemeTests.cs
@@ -6,6 +6,7 @@
using FluentAssertions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.V3Tests
diff --git a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiXmlTests.cs b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiXmlTests.cs
index c0d99793e..bb12b2585 100644
--- a/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiXmlTests.cs
+++ b/test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiXmlTests.cs
@@ -6,6 +6,7 @@
using FluentAssertions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
+using Microsoft.OpenApi.YamlReader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.V3Tests
diff --git a/test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.cs b/test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.cs
index 884ffa68c..3a23955a7 100644
--- a/test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.cs
+++ b/test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.cs
@@ -13,12 +13,11 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
using Microsoft.OpenApi.Reader;
-using Microsoft.OpenApi.Readers;
using Microsoft.OpenApi.Writers;
+using Microsoft.OpenApi.YamlReader;
using Microsoft.VisualBasic;
using VerifyXunit;
using Xunit;
-using Xunit.Abstractions;
namespace Microsoft.OpenApi.Tests.Models
{
@@ -1583,8 +1582,6 @@ public void SerializeDocumentWithReferenceButNoComponents()
}
};
- var reference = document.Paths["/"].Operations[OperationType.Get].Responses["200"].Content["application/json"].Schema.Reference;
-
// Act
var actual = document.Serialize(OpenApiSpecVersion.OpenApi2_0, OpenApiFormat.Json);
diff --git a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiCallbackReferenceTests.cs b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiCallbackReferenceTests.cs
index 3a16f4d2a..56a64c9ca 100644
--- a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiCallbackReferenceTests.cs
+++ b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiCallbackReferenceTests.cs
@@ -8,9 +8,8 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
using Microsoft.OpenApi.Reader;
-using Microsoft.OpenApi.Readers;
-using Microsoft.OpenApi.Services;
using Microsoft.OpenApi.Writers;
+using Microsoft.OpenApi.YamlReader;
using VerifyXunit;
using Xunit;
@@ -150,13 +149,13 @@ public void CallbackReferenceResolutionWorks()
Assert.NotEmpty(_externalCallbackReference.PathItems);
Assert.Single(_externalCallbackReference.PathItems);
Assert.Equal("{$request.body#/callbackUrl}", _externalCallbackReference.PathItems.First().Key.Expression);
- Assert.Equal(OperationType.Post, _externalCallbackReference.PathItems.FirstOrDefault().Value.Operations.FirstOrDefault().Key);;
+ Assert.Equal(OperationType.Post, _externalCallbackReference.PathItems.FirstOrDefault().Value.Operations.FirstOrDefault().Key);
// Local reference resolution works
Assert.NotEmpty(_localCallbackReference.PathItems);
Assert.Single(_localCallbackReference.PathItems);
Assert.Equal("{$request.body#/callbackUrl}", _localCallbackReference.PathItems.First().Key.Expression);
- Assert.Equal(OperationType.Post, _localCallbackReference.PathItems.FirstOrDefault().Value.Operations.FirstOrDefault().Key); ;
+ Assert.Equal(OperationType.Post, _localCallbackReference.PathItems.FirstOrDefault().Value.Operations.FirstOrDefault().Key);
}
[Theory]
diff --git a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiExampleReferenceTests.cs b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiExampleReferenceTests.cs
index 4ea8cdef9..237e7ead7 100644
--- a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiExampleReferenceTests.cs
+++ b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiExampleReferenceTests.cs
@@ -8,9 +8,8 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
using Microsoft.OpenApi.Reader;
-using Microsoft.OpenApi.Readers;
using Microsoft.OpenApi.Writers;
-using Microsoft.OpenApi.Services;
+using Microsoft.OpenApi.YamlReader;
using VerifyXunit;
using Xunit;
diff --git a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiHeaderReferenceTests.cs b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiHeaderReferenceTests.cs
index cfdf4ab1c..5743b7785 100644
--- a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiHeaderReferenceTests.cs
+++ b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiHeaderReferenceTests.cs
@@ -8,11 +8,10 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
using Microsoft.OpenApi.Reader;
-using Microsoft.OpenApi.Readers;
using Microsoft.OpenApi.Writers;
-using Microsoft.OpenApi.Services;
using VerifyXunit;
using Xunit;
+using Microsoft.OpenApi.YamlReader;
namespace Microsoft.OpenApi.Tests.Models.References
{
diff --git a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiLinkReferenceTests.cs b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiLinkReferenceTests.cs
index 87d2db06e..27941360e 100644
--- a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiLinkReferenceTests.cs
+++ b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiLinkReferenceTests.cs
@@ -8,9 +8,8 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
using Microsoft.OpenApi.Reader;
-using Microsoft.OpenApi.Readers;
using Microsoft.OpenApi.Writers;
-using Microsoft.OpenApi.Services;
+using Microsoft.OpenApi.YamlReader;
using VerifyXunit;
using Xunit;
diff --git a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiParameterReferenceTests.cs b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiParameterReferenceTests.cs
index c00db94f5..87c7a4c88 100644
--- a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiParameterReferenceTests.cs
+++ b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiParameterReferenceTests.cs
@@ -8,9 +8,8 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
using Microsoft.OpenApi.Reader;
-using Microsoft.OpenApi.Readers;
using Microsoft.OpenApi.Writers;
-using Microsoft.OpenApi.Services;
+using Microsoft.OpenApi.YamlReader;
using VerifyXunit;
using Xunit;
diff --git a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiPathItemReferenceTests.cs b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiPathItemReferenceTests.cs
index a2d9b525d..01c71d9ee 100644
--- a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiPathItemReferenceTests.cs
+++ b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiPathItemReferenceTests.cs
@@ -8,9 +8,8 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
using Microsoft.OpenApi.Reader;
-using Microsoft.OpenApi.Readers;
using Microsoft.OpenApi.Writers;
-using Microsoft.OpenApi.Services;
+using Microsoft.OpenApi.YamlReader;
using VerifyXunit;
using Xunit;
diff --git a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiRequestBodyReferenceTests.cs b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiRequestBodyReferenceTests.cs
index 54521e83c..49a53e866 100644
--- a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiRequestBodyReferenceTests.cs
+++ b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiRequestBodyReferenceTests.cs
@@ -8,9 +8,8 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
using Microsoft.OpenApi.Reader;
-using Microsoft.OpenApi.Readers;
using Microsoft.OpenApi.Writers;
-using Microsoft.OpenApi.Services;
+using Microsoft.OpenApi.YamlReader;
using VerifyXunit;
using Xunit;
diff --git a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiResponseReferenceTest.cs b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiResponseReferenceTest.cs
index 4b6b25564..bc8674cbc 100644
--- a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiResponseReferenceTest.cs
+++ b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiResponseReferenceTest.cs
@@ -8,11 +8,10 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
using Microsoft.OpenApi.Reader;
-using Microsoft.OpenApi.Readers;
using Microsoft.OpenApi.Writers;
-using Microsoft.OpenApi.Services;
using VerifyXunit;
using Xunit;
+using Microsoft.OpenApi.YamlReader;
namespace Microsoft.OpenApi.Tests.Models.References
{
diff --git a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiSecuritySchemeReferenceTests.cs b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiSecuritySchemeReferenceTests.cs
index 7fcd7dfd8..c74a3d86e 100644
--- a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiSecuritySchemeReferenceTests.cs
+++ b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiSecuritySchemeReferenceTests.cs
@@ -7,8 +7,8 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
using Microsoft.OpenApi.Reader;
-using Microsoft.OpenApi.Readers;
using Microsoft.OpenApi.Writers;
+using Microsoft.OpenApi.YamlReader;
using VerifyXunit;
using Xunit;
diff --git a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiTagReferenceTest.cs b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiTagReferenceTest.cs
index 82f1b27a2..f5521b937 100644
--- a/test/Microsoft.OpenApi.Tests/Models/References/OpenApiTagReferenceTest.cs
+++ b/test/Microsoft.OpenApi.Tests/Models/References/OpenApiTagReferenceTest.cs
@@ -7,8 +7,8 @@
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Models.References;
using Microsoft.OpenApi.Reader;
-using Microsoft.OpenApi.Readers;
using Microsoft.OpenApi.Writers;
+using Microsoft.OpenApi.YamlReader;
using VerifyXunit;
using Xunit;
diff --git a/test/Microsoft.OpenApi.Trimming.Tests/Microsoft.OpenApi.Trimming.Tests.csproj b/test/Microsoft.OpenApi.Trimming.Tests/Microsoft.OpenApi.Trimming.Tests.csproj
index 3e6daf74c..9cdd3dba3 100644
--- a/test/Microsoft.OpenApi.Trimming.Tests/Microsoft.OpenApi.Trimming.Tests.csproj
+++ b/test/Microsoft.OpenApi.Trimming.Tests/Microsoft.OpenApi.Trimming.Tests.csproj
@@ -13,7 +13,7 @@
-
+