Skip to content

Commit ef16deb

Browse files
Copilotbaywet
andauthored
style(reader): format diagnostic handling changes
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
1 parent 23d99b9 commit ef16deb

6 files changed

Lines changed: 21 additions & 21 deletions

File tree

src/Microsoft.OpenApi.YamlReader/OpenApiYamlReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

44
using System;

src/Microsoft.OpenApi/Interfaces/IOpenApiReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

44
using System;

src/Microsoft.OpenApi/Models/OpenApiDocument.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

44
using System;

src/Microsoft.OpenApi/Reader/OpenApiJsonReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

44
using System;

src/Microsoft.OpenApi/Reader/OpenApiModelFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

44
using System;

test/Microsoft.OpenApi.Tests/Reader/OpenApiModelFactoryTests.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
using Xunit;
2-
using Microsoft.OpenApi.Reader;
3-
using System.Threading.Tasks;
1+
using System;
42
using System.IO;
5-
using System;
63
using System.Threading;
4+
using System.Threading.Tasks;
5+
using Microsoft.OpenApi.Reader;
76
using Microsoft.OpenApi.YamlReader;
7+
using Xunit;
88

99
namespace Microsoft.OpenApi.Tests.Reader;
1010

@@ -232,7 +232,7 @@ await File.WriteAllTextAsync(tempFilePathReferrer,
232232
var baseUri = new Uri(tempFilePathReferrer);
233233
var settings = new OpenApiReaderSettings
234234
{
235-
BaseUrl = baseUri,
235+
BaseUrl = baseUri,
236236
};
237237
var readResult = await OpenApiDocument.LoadAsync(stream, settings: settings, cancellationToken: TestContext.Current.CancellationToken);
238238
Assert.Equal(OpenApiConstants.Json, readResult.Diagnostic.Format);
@@ -265,10 +265,10 @@ public async Task CanLoadANonSeekableStreamInJsonAndDetectFormat()
265265
// Given
266266
using var memoryStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(documentJson));
267267
using var nonSeekableStream = new NonSeekableStream(memoryStream);
268-
268+
269269
// When
270270
var (document, _) = await OpenApiDocument.LoadAsync(nonSeekableStream, cancellationToken: TestContext.Current.CancellationToken);
271-
271+
272272
// Then
273273
Assert.NotNull(document);
274274
Assert.Equal("Sample API", document.Info.Title);
@@ -282,10 +282,10 @@ public async Task CanLoadANonSeekableStreamInYamlAndDetectFormat()
282282
using var nonSeekableStream = new NonSeekableStream(memoryStream);
283283
var settings = new OpenApiReaderSettings();
284284
settings.AddYamlReader();
285-
285+
286286
// When
287287
var (document, _) = await OpenApiDocument.LoadAsync(nonSeekableStream, settings: settings, cancellationToken: TestContext.Current.CancellationToken);
288-
288+
289289
// Then
290290
Assert.NotNull(document);
291291
Assert.Equal("Sample API", document.Info.Title);
@@ -297,10 +297,10 @@ public async Task CanLoadAnAsyncOnlyStreamInJsonAndDetectFormat()
297297
// Given
298298
await using var memoryStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(documentJson));
299299
await using var nonSeekableStream = new AsyncOnlyStream(memoryStream);
300-
300+
301301
// When
302302
var (document, _) = await OpenApiDocument.LoadAsync(nonSeekableStream, cancellationToken: TestContext.Current.CancellationToken);
303-
303+
304304
// Then
305305
Assert.NotNull(document);
306306
Assert.Equal("Sample API", document.Info.Title);
@@ -314,10 +314,10 @@ public async Task CanLoadAnAsyncOnlyStreamInYamlAndDetectFormat()
314314
await using var nonSeekableStream = new AsyncOnlyStream(memoryStream);
315315
var settings = new OpenApiReaderSettings();
316316
settings.AddYamlReader();
317-
317+
318318
// When
319319
var (document, _) = await OpenApiDocument.LoadAsync(nonSeekableStream, settings: settings, cancellationToken: TestContext.Current.CancellationToken);
320-
320+
321321
// Then
322322
Assert.NotNull(document);
323323
Assert.Equal("Sample API", document.Info.Title);
@@ -329,10 +329,10 @@ public async Task CanLoadANonSeekableStreamInJsonAndDetectFormatWhenPrecededBySp
329329
// Given
330330
using var memoryStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(" " + documentJson));
331331
using var nonSeekableStream = new NonSeekableStream(memoryStream);
332-
332+
333333
// When
334334
var (document, _) = await OpenApiDocument.LoadAsync(nonSeekableStream, cancellationToken: TestContext.Current.CancellationToken);
335-
335+
336336
// Then
337337
Assert.NotNull(document);
338338
Assert.Equal("Sample API", document.Info.Title);
@@ -343,7 +343,7 @@ public void CanLoadAStringJsonAndDetectFormatWhenPrecededBySpaces()
343343
{
344344
// When
345345
var (document, _) = OpenApiDocument.Parse(" " + documentJson);
346-
346+
347347
// Then
348348
Assert.NotNull(document);
349349
Assert.Equal("Sample API", document.Info.Title);

0 commit comments

Comments
 (0)