-
Notifications
You must be signed in to change notification settings - Fork 271
Open
Labels
status:needs-discussionAn issue that requires more discussion internally before resolvingAn issue that requires more discussion internally before resolving
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"
}
}
}
Metadata
Metadata
Assignees
Labels
status:needs-discussionAn issue that requires more discussion internally before resolvingAn issue that requires more discussion internally before resolving