Skip to content

If a field has an explicitly null value in the JSON it is deserialized to Object.class even if later in the JSON that same field is represented as a specific type. #32

Open
@josephbleau

Description

@josephbleau

The following JSON:
{"example": [{"foo": null}, {"foo": "bar"}]}

Will generate the following APEX:
if (text == 'foo') { foo = parser.readValueAs(Object.class); }

And when executed will incur the following error:
System.JSONException: Apex Type unsupported in JSON: Object

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions