Open
Description
Describe the bug
Empty properties are removed when serializing.
Repro steps
var openApiDocument = new OpenApiDocument
{
Components = new OpenApiComponents
{
Schemas = new Dictionary<string, OpenApiSchema>
{
["Object"] = new OpenApiSchema
{
Type = "object",
Properties = new Dictionary<string, OpenApiSchema>()
}
}
}
};
var test = JObject.Parse(openApiDocument.SerializeAsJson(OpenApiSpecVersion.OpenApi2_0));
Console.WriteLine(test);
Expected result
{
"swagger": "2.0",
"info": {},
"paths": {},
"definitions": {
"Object": {
"type": "object"
"properties": {}
}
}
}
Actual result
{
"swagger": "2.0",
"info": {},
"paths": {},
"definitions": {
"Object": {
"type": "object"
}
}
}