Skip to content

jackson should provides a method which can deserialize a collection that contains different type items #3592

Closed
@zrlw

Description

@zrlw

Is your feature request related to a problem? Please describe.

String collectionJson = "[ {\"school" : \"xxx\", ... },  {\"student" : \"yyy\", ...} ]";
List<JavaType> javaTypeList = new ArrayList<>();
javaTypeList.add(schoolJavaType);
javaTypeList.add(studentJavaType);
// like fastjson#parseArray(collectionJsonString, arrayOfJavaLangReflectType);
List<Object> objectList = objectMapper.parseListByType(collectionJson, javaTypeList);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions