IEvangelist/azure-cosmos-dotnet-repository

Ignore null property for timeToLive when serialising

philip-reed opened this issue · 2 comments

We are continuously addressing and improving the SDK, if possible, make sure the problem persist in the latest SDK version.

Describe the bug
The TimeToLive wrapping property on FullItem should be ignored if null when serialising to avoid confusion when reading the raw json (as a human). It looks like a typo when the real ttl property is ignored when null, and could be misleading.

To Reproduce
Set a null value for TimeToLive on a FullItem and note that "TimeToLive": null, while ttl is not present.

Expected behavior
The TimeToLive wrapping property should also have a [JsonProperty("timeToLive", NullValueHandling = NullValueHandling.Ignore)] to match the ttl property.

Actual behavior
image

Environment summary
SDK Version: 7.0.0.0

Additional context
None

Looks like this is happening on the EventItem also.
I'm not sure if the TimeToLive property should be ignored when null, or ignored altogether?

Closed by #315