-
Notifications
You must be signed in to change notification settings - Fork 293
Closed
Description
JsonSerializer is attempting several type casts.
Because of the if statements, there are several failed casts before finding the correct matching type.
Option 1
I propose to remove the serialization entirely by appending the TelemetryName and BaseType to the ITelemetry interface. This would completely eliminate any need for casting here.
This isn't viable because ITelemetry is the foundation of the Common Schema and cannot take changes.
Option 2
If we don't want to add properties to ITelemetry we can instead introduce a new interface ISerializableTelemetry. With this there would be only one type cast (ITelemetry => ISerializableTelemetry).
This has the benefit of being applied only to our AI Telemetry objects and won't affect external types.