You are asking Jackson to parse a StudentList. Tell it to parse a List (of students) instead. Since List is generic you will typically use a TypeReference

List<Student> participantJsonList = mapper.readValue(jsonString, new TypeReference<List<Student>>(){});
Answer from Manos Nikolaidis on Stack Overflow
🌐
Baeldung
baeldung.com › home › json › jackson › convert json array to java list
Convert JSON Array to Java List | Baeldung
August 13, 2025 - In the above example, we’ve defined the target type as List<Product>. Then, we use the readValue() method of the ObjectMapper object to convert the JSON array String to a List. Similar to the assertion discussed previously, finally, we compare ...
Discussions

Converting a JSON string into an object with a list of objects inside it - Java - Stack Overflow
How do I "unpack" the JSON into ... objects as its attributes? (Ideally, it would be using the Gson library) ... Gson gson = new Gson(); Type listType = new TypeToken>(){}.getType(); List tokenList = gson.fromJson(jsonString, listType); System.out.println(tokenList.get(0)); ... Well ... What did reading the documentation tell you? ... import java.util.List; ... More on stackoverflow.com
🌐 stackoverflow.com
How to convert list data into json in java - Stack Overflow
I have a function which is returning Data as List in java class. Now as per my need, I have to convert it into Json Format. Below is my function code snippet: public static List More on stackoverflow.com
🌐 stackoverflow.com
java - Convert json to Object List - Stack Overflow
Communities for your favorite technologies. Explore all Collectives · Ask questions, find answers and collaborate at work with Stack Overflow for Teams More on stackoverflow.com
🌐 stackoverflow.com
April 26, 2017
java - How to convert JSON file to List - Stack Overflow
I am trying to turn a JSON where there is an array of objects for each object 4 properties: question, answer 1, answer 2, answer 3, correct answer. I created a Class called Question. I want to crea... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Mkyong
mkyong.com › home › java › how to parse json array with jackson
How to parse JSON Array with Jackson - Mkyong.com
April 23, 2024 - The technique is the same with the above example 4: first converts the JSON string to Map<String, List<Person>> and manually get the List<Person> later. { "Person" : [ { "name" : "mkyong", "age" : 42 }, { "name" : "ah pig", "age" : 20 } ] } ...
🌐
TutorialsPoint
tutorialspoint.com › how-can-we-convert-a-json-array-to-a-list-using-jackson-in-java
How can we convert a JSON array to a list using Jackson in Java?\\n
June 5, 2025 - import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import java.util.List; import java.io.IOException; import java.util.ArrayList; public class JsonArrayToList{ public static void main(String[] args) { String jsonArray = "[{"name":"John","age":30},{"name":"Jane","age":25}]"; ObjectMapper objectMapper = new ObjectMapper(); try { List<Person> personList = objectMapper.readValue(jsonArray, new TypeReference<List<Person>>(){}); for (Person person : personList) { System.out.println("Name: " + person.getName() + ", Age: " + person.getAge()); } }
🌐
Makeinjava
makeinjava.com › home › convert list of objects to/from json in java (jackson objectmapper/ example)
Convert list of objects to/from JSON in java (jackson objectmapper/example)
January 1, 2024 - We will use the jackson’s objectmapper, to serialize list of objects to JSON & deserialize JSON to List of objects. We will create Person class & we will perform following operations with Person class. ... Convert the JSON to List of Person objects.
🌐
How to do in Java
howtodoinjava.com › home › convert json array to list: gson, jackson and org.json
Convert JSON Array to List: Gson, Jackson and Org.json
September 25, 2023 - The following code parses a JSON array containing person data and converts it into a list of Java Person objects using the JSONArray and JSONObject classes.
🌐
Attacomsian
attacomsian.com › blog › jackson-convert-json-array-to-from-java-list
Convert JSON array to a list using Jackson in Java
November 6, 2022 - Now we can use the readValue() method from the ObjectMapper class to transform the above JSON array to a list of User objects, as shown below: try { // JSON array String json = "[{\"name\":\"John Doe\",\"email\":\"john.doe@example.com\"," + ...
Find elsewhere
🌐
Stack Abuse
stackabuse.com › converting-json-array-to-a-java-array-or-list
Convert JSON Array to a Java Array or List with Jackson
September 8, 2020 - Using Jackson's ObjectMapper class, it's easy to read values and map them to an object, or an array of objects. We just use the readValue() method, passing the JSON contents and the class we'd like to map to.
🌐
HowToDoInJava
howtodoinjava.com › home › gson › gson – parse json array to java array or list
Gson - Parse JSON Array to Java Array or List
April 4, 2023 - Here ArrayItem is the class type of data elements in the array. ArrayItem[] userArray = new Gson().fromJson(jsonSource, ArrayItem[].class); For converting such JSON array to a List, we need to use TypeToken class.
🌐
Java Code Geeks
javacodegeeks.com › home › core java
Converting JSON Array to Java List with Gson - Java Code Geeks
April 25, 2024 - We parse a JSON array into a JsonArray using Gson’s JsonParser. Then, we iterate over each element of the array, converting them into Java objects using Gson’s fromJson() method. Finally, we add each Java object to a List.
Top answer
1 of 1
6

You can convert the result to an object list, or you can pass in a type parameter rather than the List class.

String jsonString = "[{\"id\": \"0\", \"ip\": \"123\", \"mac\": \"456\"}, {\"id\": \"1\", \"ip\": \"111\", \"mac\": \"222\"}]";

With Object

List<Object> items = objectMapper.readValue(
    jsonString,
    objectMapper.getTypeFactory().constructParametricType(List.class, Object.class)
);

With SlaveEntity

List<SlaveEntity> items = objectMapper.readValue(
    jsonString,
    objectMapper.getTypeFactory().constructCollectionType(List.class, SlaveEntity.class)
);

Update

This is what I have come up with, and it works.

EntityTest

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.databind.ObjectMapper;

public class EntityTest {
    public static void main(String[] args) {
        String json = "[{\"id\": \"0\", \"ip\": \"123\", \"mac\": \"456\"}, {\"id\": \"1\", \"ip\": \"111\", \"mac\": \"222\"}]";

        for (SlaveEntity entity : jsonToSlaveEntity(json)) {
            System.out.println(entity);
        }
    }

    public static List<SlaveEntity> jsonToSlaveEntity(String json) {
        ObjectMapper objectMapper = new ObjectMapper();

        try {
           return objectMapper.readValue(
                   json,
                objectMapper.getTypeFactory().constructCollectionType(List.class, SlaveEntity.class)
            );

        } catch (IOException e) {
            e.printStackTrace();
        }
        return new ArrayList<SlaveEntity>();
    }
}

BaseEntity

public class BaseEntity {
    private long id;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }
}

SlaveEntity

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;

import com.fasterxml.jackson.annotation.JsonProperty;

public class SlaveEntity extends BaseEntity {
    private String ip;

    @JsonProperty("mac")
    private String macAddress;

    private String status;

    @OneToMany(mappedBy = "slave", targetEntity = PositionEntity.class, fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    private List<PositionEntity> positions;

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getMacAddress() {
        return macAddress;
    }

    public void setMacAddress(String macAddress) {
        this.macAddress = macAddress;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public List<PositionEntity> getPositions() {
        return positions;
    }

    public void setPositions(List<PositionEntity> positions) {
        this.positions = positions;
    }

    @Override
    public String toString() {
        return String.format(
                "SlaveEntity [id=%d, ip=%s, mac=%s, status=%s, positions=%s]",
                getId(), ip, macAddress, status, positions);
    }
}

PositionEntity

public class PositionEntity {
    // ?
}

Result

SlaveEntity [id=0, ip=123, mac=456, status=null, positions=null]
SlaveEntity [id=1, ip=111, mac=222, status=null, positions=null]
🌐
Java Tech Blog
javanexus.com › blog › converting-json-array-to-java-list-gson-nested-objects
Converting JSON Array to Java List with Gson: Handling Nested Objects | Java Tech Blog
May 9, 2024 - Learn how to seamlessly convert complex nested JSON arrays into Java Lists using Gson. Master JSON handling in Java!
🌐
CopyProgramming
copyprogramming.com › howto › converting-jsonobject-to-object-list
Java: Transforming a JSONObject into a List of Objects
April 4, 2023 - How to Get Value from JSON Object in Java Example, In the above example, first name, city, and age are names, and John, Florida, and 22 are their values, respectively. Java JSONObject Class. Java provides the JSONObject class that is defined in the org.json package. It denotes an immutable (unchallengeable) JSONObject value. The object value is an unordered group of … ... converting jsonobject to object list parsing json to list of objects in java convert json to object list