-
Notifications
You must be signed in to change notification settings - Fork 271
Open
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"
}
}
}
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