Closed DCourtel closed 5 months ago
Thanks for raising this @DCourtel
Any chance you can confirm if these properties can be sent over to the graph API? At the moment these properties are not serialized due the metadata used to generating the SDK describing them as read-only and thus should not be serialized to be sent over wire to the API.
For people who encounter the same issue, this is a workaround: Provide value for the OnStartObjectSerialization property of the JsonSerializationWriter class:
using var _serializationWriter = new JsonSerializationWriter()
{
OnStartObjectSerialization = new Action<IParsable, ISerializationWriter>(OnStartObjectSerialization),
};
And define the content of the Action as:
private static void OnStartObjectSerialization(IParsable value, ISerializationWriter writer)
{
switch (value)
{
case MobileAppContentFile mobileAppContentFile:
writer.WriteStringValue("azureStorageUri", mobileAppContentFile.AzureStorageUri);
writer.WriteDateTimeOffsetValue("azureStorageUriExpirationDateTime", mobileAppContentFile.AzureStorageUriExpirationDateTime);
writer.WriteDateTimeOffsetValue("createdDateTime", mobileAppContentFile.CreatedDateTime);
writer.WriteBoolValue("isCommitted", mobileAppContentFile.IsCommitted);
break;
default:
break;
}
}
Since v5.68, the Serialize method of the MobileAppContentFile class does not serialize properties marked as read-only.
v5.67:
v5.68:
Is there a reason for that, or is it a bug? That breaks my unit tests.
Thanks.