You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
you will get an exception: Project raised exception class EJsonCastException with message 'Cannot cast Integer into Object'.
Solution: modify function TMVCJsonDataObjectsSerializer.JSONObjectToRecord in MVCFramework.Serializer.JsonDataObjects.pas.
Before:
lKeyName := TMVCSerializerHelper.GetKeyName(lField, lRTTIType);
if lField.FieldType.IsRecord thenbegin
JSONObjectToNestedRecordField(JSONObject.O[lKeyName], lField, 0, lBuffer);
end
after
lKeyName := TMVCSerializerHelper.GetKeyName(lField, lRTTIType);
if lField.FieldType.IsRecord andnot lField.FieldType.Handle.NameFld.ToString.StartsWith('Nullable') thenbegin
JSONObjectToNestedRecordField(JSONObject.O[lKeyName], lField, 0, lBuffer);
end
The text was updated successfully, but these errors were encountered:
Hi, Daniele,
If you try to deserialize JSON like this:
into
you will get an exception: Project raised exception class EJsonCastException with message 'Cannot cast Integer into Object'.
Solution: modify function TMVCJsonDataObjectsSerializer.JSONObjectToRecord in MVCFramework.Serializer.JsonDataObjects.pas.
Before:
after
The text was updated successfully, but these errors were encountered: