|
11 | 11 | using Microsoft.OpenApi.Extensions; |
12 | 12 | using Microsoft.OpenApi.Models; |
13 | 13 | using Microsoft.OpenApi.Reader; |
14 | | -using Microsoft.OpenApi.Readers; |
15 | 14 | using Microsoft.OpenApi.Services; |
16 | 15 | using Microsoft.OpenApi.Validations; |
| 16 | +using Microsoft.OpenApi.Writers; |
17 | 17 |
|
18 | 18 | namespace Microsoft.OpenApi.Workbench |
19 | 19 | { |
@@ -242,7 +242,7 @@ internal async Task ParseDocumentAsync() |
242 | 242 | : new("file://" + Path.GetDirectoryName(_inputFile) + "/"); |
243 | 243 | } |
244 | 244 |
|
245 | | - var readResult = await OpenApiDocument.LoadAsync(stream, Format.GetDisplayName()); |
| 245 | + var readResult = await OpenApiDocument.LoadAsync(stream, Format.GetDisplayName().ToLowerInvariant(), settings); |
246 | 246 | var document = readResult.Document; |
247 | 247 | var context = readResult.Diagnostic; |
248 | 248 |
|
@@ -298,13 +298,13 @@ internal async Task ParseDocumentAsync() |
298 | 298 | /// </summary> |
299 | 299 | private async Task<string> WriteContentsAsync(OpenApiDocument document) |
300 | 300 | { |
301 | | - var outputStream = new MemoryStream(); |
| 301 | + using var outputStream = new MemoryStream(); |
302 | 302 |
|
303 | 303 | await document.SerializeAsync( |
304 | 304 | outputStream, |
305 | 305 | Version, |
306 | 306 | Format, |
307 | | - (Writers.OpenApiWriterSettings)new() |
| 307 | + new OpenApiWriterSettings() |
308 | 308 | { |
309 | 309 | InlineLocalReferences = InlineLocal, |
310 | 310 | InlineExternalReferences = InlineExternal |
|
0 commit comments