private static void GetRuntimePropertyInfo(object value, JsonClassInfo jsonClassInfo, ref JsonPropertyInfo jsonPropertyInfo, JsonSerializerOptions options) { if (value != null) { Type runtimeType = value.GetType(); // Nothing to do for typeof(object) if (runtimeType != typeof(object)) { jsonPropertyInfo = jsonClassInfo.GetOrAddPolymorphicProperty(jsonPropertyInfo, runtimeType, options); } } }