our org use a managed package PCK1. This package has the following class:

global class Parent {
    global class Child {
        global string field1;
        global string field2;
        global string field3;

We serialize the object as json like below:

PCK1.Parent.Child obj = new PCK1.Parent.Child();
obj.field1 = 'test 1';
obj.field2 = 'test 2';
obj.field3 = 'test 3';


This code works fine when PCK1.Parent class is using API>59 otherwise we got the following error: Type cannot be serialized

I tried to check API changelogs/update but nothing special related to this issue.

Anyone has an idea about this ? Thx

1 Answer 1


This almost certainly relates to the @JsonAccess annotation and the release updates related to it (e.g. this one).

This annotation enables or disables use of JSON serialization for managed package classes outside the package.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .