Closed cowlinb6 closed 5 months ago
Thanks for raising this @cowlinb6
I suspect the error you're seeing is related to https://github.com/microsoft/kiota/pull/4514. However, AdditionalData
should be automatically initialized when the object is created in the constructor. Do you still get the error if you add the line below before serializing?
callRecord.AdditionalData = new();
If I add this:
callRecord.AdditionalData = new Dictionary<string, object>();
var raw = KiotaJsonSerializer.SerializeAsString<CallRecord>(callRecord);
Then it fixes the exception but I only get this in the response:
This is probably because of the backingStore. We're looking to enhance the KiotaJsonSerializer
to have the option to set the flag for you.
Does the following work for you?
var callRecord = await _graphServiceClient.Communications.CallRecords[id]
.GetAsync((config) =>
{
config.QueryParameters.Expand = new string[] { "sessions($expand=segments)" };
});
callRecord.BackingStore.InitializationCompleted = false;
var raw = KiotaJsonSerializer.SerializeAsString<CallRecord>(callRecord);
Yes this does work.
Thanks @andrueastman for the quick response on this
Thanks for confirming. We'll close this one for now.
We're looking to enhance the KiotaJsonSerializer to have the option to set the flag for you.
Currently tracked for all languages via https://github.com/microsoft/kiota-java/issues/1131
Similar issue to #212 but with CallRecord types.
When attempting to serialise a CallRecord type:
This fails with the error below:
How should I be serialising this type?