-
Notifications
You must be signed in to change notification settings - Fork 287
Empty property removed when serializing #2087
Copy link
Copy link
Closed as not planned
Labels
status:waiting-for-author-feedbackIssue that we've responded but needs author feedback to closeIssue that we've responded but needs author feedback to close
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"
}
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
status:waiting-for-author-feedbackIssue that we've responded but needs author feedback to closeIssue that we've responded but needs author feedback to close