Closed
Description
In 2.0.0-preview2
, it appears that the tags
property in the OpenAPI document isn't serialized correctly as a list of objects. For example, the following code:
using System;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Writers;
using System.IO;
using System.Globalization;
var document = new OpenApiDocument();
document.Tags = [new OpenApiTag { Name = "test" }];
var outputStringWriter = new StringWriter(CultureInfo.InvariantCulture);
var writer = new OpenApiJsonWriter(outputStringWriter);
document.SerializeAsV2(writer);
Console.WriteLine(outputStringWriter.ToString());
Produces the following document:
{
"swagger": "2.0",
"info": { },
"paths": { },
"tags": [
"test"
]
}
Which in turn cannot be loaded by the serialization APIs without errors. This happens across all OpenAPI versions (SerializeAsV3
, SerializeAsV31
).
Metadata
Metadata
Assignees
Labels
No labels