You need to sign in to do that
Don't have an account?
Robert Taylor 81
Why does ContentVersion fail to deserialize with VersionData?
Why does the following fail to deserialize?
Blob b = Blob.valueOf('test1'); ContentVersion cv = new ContentVersion(VersionData=b); String cvString = JSON.serialize(cv); System.debug('ContentVersion serialized: ' + cvString); ContentVersion cvd = (ContentVersion)JSON.deserialize(cvString, ContentVersion.class);
Output
15:15:38.4 (5368573)|USER_DEBUG|[248]|DEBUG|ContentVersion serialized: {"attributes":{"type":"ContentVersion"},"VersionData":{"asByteArray":"dGVzdDE=","inputStream":{},"length":5,"maxToKeep":6}}
15:15:38.4 (10114668)|FATAL_ERROR|System.JSONException: Cannot deserialize instance of base64 from START_OBJECT value { or request may be missing a required field at [line:1, column:40]
Refer the below link have fix for the similar kind of issue.
https://github.com/mattaddy/SObjectFabricator/issues/16
If this helps, Please mark it as best answer.
Thanks!!
https://www.myadvocateaurora.net/