Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Microsoft.OpenApi/Any/OpenApiPrimitive.cs
Original file line numberDiff line numberDiff line change
Expand Up@@ -118,7 +118,7 @@ public void Write(IOpenApiWriter writer, OpenApiSpecVersion specVersion)

case PrimitiveType.Date:
var dateValue = (OpenApiDate)(IOpenApiPrimitive)this;
writer.WriteValue(dateValue.Value);
writer.WriteValue(dateValue.Value.ToShortDateString());
break;

case PrimitiveType.DateTime:
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,6 +21,7 @@
}
]
}
]
],
"aDate": "12/12/2022"
}
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
{"value":{"versions":[{"status":"Status1","id":"v1","links":[{"href":"http://example.com/1","rel":"sampleRel1"}]},{"status":"Status2","id":"v2","links":[{"href":"http://example.com/2","rel":"sampleRel2"}]}]}}
{"value":{"versions":[{"status":"Status1","id":"v1","links":[{"href":"http://example.com/1","rel":"sampleRel1"}]},{"status":"Status2","id":"v2","links":[{"href":"http://example.com/2","rel":"sampleRel2"}]}],"aDate":"12/12/2022"}}
4 changes: 3 additions & 1 deletion test/Microsoft.OpenApi.Tests/Models/OpenApiExampleTests.cs
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

using System;
using System.Globalization;
using System.IO;
using System.Text;
Expand DownExpand Up@@ -95,7 +96,8 @@ public class OpenApiExampleTests
}
}
}
}
},
["aDate"] = new OpenApiDate(DateTime.Parse("12/12/2022 00:00:00"))
}
};

Expand Down