Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/images/workbench.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/Microsoft.OpenApi.Workbench/MainModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
using Microsoft.OpenApi.Extensions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Reader;
using Microsoft.OpenApi.Readers;
using Microsoft.OpenApi.Services;
using Microsoft.OpenApi.Validations;
using Microsoft.OpenApi.Writers;

namespace Microsoft.OpenApi.Workbench
{
Expand Down Expand Up @@ -209,7 +209,7 @@
/// The core method of the class.
/// Runs the parsing and serializing.
/// </summary>
internal async Task ParseDocumentAsync()

Check warning on line 212 in src/Microsoft.OpenApi.Workbench/MainModel.cs

View workflow job for this annotation

GitHub Actions / Build

Refactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)

Check warning on line 212 in src/Microsoft.OpenApi.Workbench/MainModel.cs

View workflow job for this annotation

GitHub Actions / Build

Refactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)
{
Stream stream = null;
try
Expand Down Expand Up @@ -242,7 +242,7 @@
: new("file://" + Path.GetDirectoryName(_inputFile) + "/");
}

var readResult = await OpenApiDocument.LoadAsync(stream, Format.GetDisplayName());
var readResult = await OpenApiDocument.LoadAsync(stream, Format.GetDisplayName().ToLowerInvariant(), settings);
var document = readResult.Document;
var context = readResult.Diagnostic;

Expand Down Expand Up @@ -298,13 +298,13 @@
/// </summary>
private async Task<string> WriteContentsAsync(OpenApiDocument document)
{
var outputStream = new MemoryStream();
using var outputStream = new MemoryStream();

await document.SerializeAsync(
outputStream,
Version,
Format,
(Writers.OpenApiWriterSettings)new()
new OpenApiWriterSettings()
{
InlineLocalReferences = InlineLocal,
InlineExternalReferences = InlineExternal
Expand Down