Skip to content

Commit 955f7fb

Browse files
committed
Fix issues from resolving merge conflicts
1 parent 3154d45 commit 955f7fb

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/Microsoft.OpenApi/Reader/OpenApiJsonReader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ public async Task<ReadResult> ReadAsync(Stream input,
128128
diagnostic.Errors.Add(new OpenApiError($"#line={ex.LineNumber}", $"Please provide the correct format, {ex.Message}"));
129129
return new ReadResult
130130
{
131-
OpenApiDocument = null,
132-
OpenApiDiagnostic = diagnostic
131+
Document = null,
132+
Diagnostic = diagnostic
133133
};
134134
}
135135

src/Microsoft.OpenApi/Reader/OpenApiModelFactory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,12 @@ private static async Task<ReadResult> InternalLoadAsync(Stream input, string for
209209

210210
if (settings?.LoadExternalRefs ?? DefaultReaderSettings.LoadExternalRefs)
211211
{
212-
var diagnosticExternalRefs = await LoadExternalRefsAsync(readResult.OpenApiDocument, cancellationToken, settings, format);
212+
var diagnosticExternalRefs = await LoadExternalRefsAsync(readResult.Document, cancellationToken, settings, format);
213213
// Merge diagnostics of external reference
214214
if (diagnosticExternalRefs != null)
215215
{
216-
readResult.OpenApiDiagnostic.Errors.AddRange(diagnosticExternalRefs.Errors);
217-
readResult.OpenApiDiagnostic.Warnings.AddRange(diagnosticExternalRefs.Warnings);
216+
readResult.Diagnostic.Errors.AddRange(diagnosticExternalRefs.Errors);
217+
readResult.Diagnostic.Warnings.AddRange(diagnosticExternalRefs.Warnings);
218218
}
219219
}
220220

test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiFilterServiceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public async Task CopiesOverAllReferencedComponentsToTheSubsetDocumentCorrectly(
232232

233233
// Act
234234
using var stream = File.OpenRead(filePath);
235-
var doc = OpenApiDocument.Load(stream, "yaml").Document;
235+
var doc = (await OpenApiDocument.LoadAsync(stream, "yaml")).Document;
236236
var predicate = OpenApiFilterService.CreatePredicate(operationIds: operationIds);
237237
var subsetOpenApiDocument = OpenApiFilterService.CreateFilteredDocument(doc, predicate);
238238

test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiDocumentTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public void ParseInlineStringWithoutProvidingFormatSucceeds()
108108
""";
109109

110110
var readResult = OpenApiDocument.Parse(stringOpenApiDoc);
111-
readResult.OpenApiDocument.Info.Title.Should().Be("Sample API");
111+
readResult.Document.Info.Title.Should().Be("Sample API");
112112
}
113113

114114
[Fact]
@@ -1323,7 +1323,7 @@ public async Task ParseDocWithRefsUsingProxyReferencesSucceeds()
13231323
using var stream = Resources.GetStream(System.IO.Path.Combine(SampleFolderPath, "minifiedPetStore.yaml"));
13241324

13251325
// Act
1326-
var doc = OpenApiDocument.Load(stream, "yaml").Document;
1326+
var doc = (await OpenApiDocument.LoadAsync(stream)).Document;
13271327
var actualParam = doc.Paths["/pets"].Operations[OperationType.Get].Parameters[0];
13281328
var outputDoc = doc.SerializeAsYaml(OpenApiSpecVersion.OpenApi3_0).MakeLineBreaksEnvironmentNeutral();
13291329
var expectedParam = expected.Paths["/pets"].Operations[OperationType.Get].Parameters[0];

test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1702,7 +1702,7 @@ And reading in similar documents(one has a whitespace) yields the same hash code
17021702

17031703
private static async Task<OpenApiDocument> ParseInputFileAsync(string filePath)
17041704
{
1705-
var openApiDoc = (await OpenApiDocument.LoadAsync(filePath)).OpenApiDocument;
1705+
var openApiDoc = (await OpenApiDocument.LoadAsync(filePath)).Document;
17061706
return openApiDoc;
17071707
}
17081708

0 commit comments

Comments
 (0)