Bug description
Consider a Uri with default port (https://example.com:443/)
After a serialization/deserialization roundtrip, the resulting Uri.OriginalString doesn't contain the port anymore (https://example.com/). The messagepack UriFormatter should use Uri.OriginalString instead of Uri.ToString() to ensure lossless serialization?
Newtonsoft.Json and System.Text.Json both use Uri.OriginalString: dotnet/corefx#39015
Repro steps
var uri = new Uri("https://example.com:443/");
// Call Serialize/Deserialize, that's all.
byte[] bytes = MessagePackSerializer.Serialize(uri);
var uri2 = MessagePackSerializer.Deserialize<Uri>(bytes);
Console.WriteLine("Before: " + uri.OriginalString);
Console.WriteLine("After : " + uri2.OriginalString);
// Before: https://example.com:443/
// After : https://example.com/
Expected behavior
Resulting Uri.OriginalString should still be https://example.com:443/
Actual behavior
Resulting Uri.OriginalString is https://example.com/
- Version used: 2.2.60
- Runtime: .NET Framework 4.7.2
Bug description
Consider a Uri with default port (https://example.com:443/)
After a serialization/deserialization roundtrip, the resulting
Uri.OriginalStringdoesn't contain the port anymore (https://example.com/). The messagepackUriFormattershould useUri.OriginalStringinstead ofUri.ToString()to ensure lossless serialization?Newtonsoft.JsonandSystem.Text.Jsonboth useUri.OriginalString: dotnet/corefx#39015Repro steps
Expected behavior
Resulting Uri.OriginalString should still be https://example.com:443/
Actual behavior
Resulting Uri.OriginalString is https://example.com/