You can do this:

List<Artwork> returnedArtworks = Arrays.asList(response.getBody().as(Artwork[].class));

The trick is to deserialize JSON to an array of objects (because there is no difference between the JSON string of an array or a list), then convert the array to a list.

Answer from volatilevar on Stack Overflow
🌐
TOOLSQA
toolsqa.com › rest-assured › deserialize-json-response
Deserialize JSON Response using Rest Assured
February 12, 2022 - Learn how to serialize and deserialize JSON responses using REST Assured library with example codes and Live API.
🌐
TOOLSQA
toolsqa.com › rest-assured › deserialize-json-array
How to Deserialize JSON Array using JSONPath of Rest Assured?
We all are familiar with Serialization and De-serialization support built-in in Rest-Assured. Let us try to convert the searched nodes directly into an object representation. In this example let us retrieve all the books from the JSON response. We will retrieve all the books as a List of Books class.
🌐
Applitools
testautomationu.applitools.com › automating-your-api-tests-with-rest-assured › chapter6.html
Chapter 6 - (De-) Serialization of Java Objects in REST Assured Tests
So, the first example that I want to show you of working with Java objects in your REST Assured tests demonstrates how to transform an API response, which again can be in XML or in JSON format to an instance of an actual Java object.
🌐
Makeseleniumeasy
makeseleniumeasy.com › 2021 › 01 › 05 › rest-assured-tutorial-61-deserialize-using-jsonpath
REST Assured Tutorial 61 – Deserialize Using JsonPath
January 5, 2021 - JsonPath class provides a method named “T getObject(String path, Class objectType)” which helps to get the result of an Object path expression as a java Object. package DeserializationUsingJsonPath; import io.restassured.path.json.JsonPath; public class DeserializationUsingJsonPath { public static void main(String[] args) { String jsonObject = "{\r\n" + " \"id\": 1,\r\n" + " \"first_name\": \"Lothaire\",\r\n" + " \"last_name\": \"Benazet\",\r\n" + " \"email\": \"[email protected]\",\r\n" + " \"gender\": \"Male\"\r\n" + "}"; JsonPath jsonPath = JsonPath.from(jsonObject); Employee employee =
🌐
YouTube
youtube.com › watch
Part 17 - Rest Assured - Deserialize Simple JSON response - YouTube
In this video I've talked about how to Deserialize Simple JSON response into Rest Assured.All this code is posted at Github https://github.com/qaboxletstest/...
Published   December 8, 2021
Views   1K
🌐
Medium
medium.com › @shubameg48 › serialization-and-deserialization-in-rest-assured-api-testing-6e676c9adefa
Serialization and Deserialization in Rest Assured API Testing | by Subashini Meganathan | Medium
September 24, 2021 - In the following Test class, we will create a Rest Assured Test to complete the serialization process by passing the above pojo class to the API. First, We will create an object of the above pojo class as ... RestAssured will automatically convert the POJO class into a json object and as of now the setters will be empty { “programId”: “0”, “programName”: “ ”, “programDescription”: “ ”, “online”: “ ” }
🌐
Medium
scrolltest.medium.com › rest-assured-api-testing-tutorial-serialization-and-deserialization-in-restassured-2e6895c85efc
Rest Assured API Testing Tutorial | Serialization and Deserialization in RestAssured | by Pramod Dutta | Medium
December 15, 2021 - Serialize objects into a stream of JSON data and deserialize stream of data to objects that are exchanged between the REST web service. Deserialization is the process of converting a stream of data into objects.
Find elsewhere
🌐
Toolify
toolify.ai › gpts › learn-how-to-deserialize-json-response-in-restassured-134111
Learn how to deserialize JSON response in RestAssured
In Rest Assured, deserialization can be performed using the .as() method, passing the desired POJO class as the parameter. Rest Assured internally handles the deserialization process and maps the JSON response to the POJO objects.
🌐
Techndeck
techndeck.com › serialization-and-de-serialization-using-rest-assured
Serialization and Deserialization using Rest Assured - Techndeck
April 9, 2022 - Serialization and Deserialization in Rest Assured. How to Serialize in Java? serialize POJO into JSON Object and de-serialize API Response...
🌐
DEV Community
dev.to › promode › rest-assured-api-testing-tutorial-serialization-and-deserialization-in-restassured-day-17-680
🔥 Rest Assured API Testing Tutorial | Serialization and Deserialization in RestAssured | Day 17 - DEV Community
August 11, 2020 - Serialize objects into a stream of JSON data and deserialize stream of data to objects that are exchanged between the REST web service. Deserialization is the process of converting a stream of data into objects.
🌐
Medium
medium.com › @dhadiprasetyo › a-comprehensive-guide-to-serialization-and-deserialization-of-pojo-in-rest-assured-c70993985a6
A Comprehensive Guide to Serialization and Deserialization of POJO in Rest Assured | by Darmawan Hadiprasetyo | Medium
September 16, 2023 - In this example, the ObjectMapper is used to deserialize the JSON response into a User object. When integrating serialization and deserialization with Rest Assured, using Lombok can streamline the creation of POJOs by reducing boilerplate code for getter, setter, and constructor methods.
🌐
On Test Automation
ontestautomation.com › deserializing-pojos-in-rest-assured
(De)serializing POJOs in REST Assured | On Test Automation
October 5, 2016 - Say we want to transmit the information stored in this object instance to a RESTful API, without having to map each individual property of our car to a corresponding field in the request. REST Assured supports this by allowing you to serialize the myCar object instance as follows: @Test public void testCarSerialization() { given(). contentType("application/json").
🌐
Makeseleniumeasy
makeseleniumeasy.com › 2022 › 02 › 21 › rest-assured-tutorial-75-what-is-serialization-and-deserialization-in-rest-assured
REST Assured Tutorial 75 – What Is Serialization And Deserialization In Rest Assured?
package SerializationDeserialization; import java.util.Map; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import pojo.Person; public class ConvertJsonToPojo { public static void main(String[] args) throws JsonProcessingException { String jsonObject = "{\r\n" + " \"name\" : \"Amod\",\r\n" + " \"age\" : 30\r\n" + "}"; ObjectMapper objectMapper = new ObjectMapper(); // Deserialize JSON object to POJO Object Person person = objectMapper.readValue(jsonObject, Person.class); // Once we get Person Object we can use getter method to fetc
🌐
James Willett
james-willett.com › rest-assured-serialization-with-json-and-xml
REST Assured ObjectMapper Serialization with JSON and XML | James Willett
December 15, 2015 - How to serialize a POJO (Plain old Java Object) and send that in your API call in REST Assured
🌐
CodingTechRoom
codingtechroom.com › question › deserialize-json-response-list-pojo-rest-assured
How to Deserialize a Response JSON to List<POJO> Using Rest Assured - CodingTechRoom
import io.restassured.RestAssured; import io.restassured.response.Response; // Define your POJO class public class MyPOJO { private String name; private int age; // getters and setters } // Sending a request and deserializing JSON to List<POJO> Response response = RestAssured.given() .when() .get("https://api.example.com/data"); List<MyPOJO> myList = response.jsonPath().getList("data", MyPOJO.class); The JSON response structure is complex and needs to be mapped to appropriate POJO classes. Using the correct Rest Assured methods to extract data from the JSON response.
🌐
Makeseleniumeasy
makeseleniumeasy.com › 2020 › 06 › 28 › rest-assured-tutorial-33-de-serialization-json-object-to-java-object-using-jackson-api
REST Assured Tutorial 33 – De-Serialization – JSON Object To Java Object Using Jackson API
June 28, 2020 - package SerializationDeserialization; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; public class DeserializeJsonToJava { public static void main(String[] args) throws JsonMappingException, JsonProcessingException { String jsonString = "{\r\n" + " \"firstName\" : \"Amod\",\r\n" + " \"lastName\" : \"Mahajan\",\r\n" + " \"gender\" : \"M\",\r\n" + " \"age\" : 29,\r\n" + " \"salary\" : 10987.77,\r\n" + " \"married\" : false\r\n" + "}"; ObjectMapper objectMapper = new ObjectMa
🌐
Google Groups
groups.google.com › g › rest-assured › c › a0m6wKzzy6c
Deserializing JSON array of objects into POJO
public class Branch { @NotNull private String id; @NotNull private String name; @NotNull @Past private Date creationDate; @NotNull private Date lastModifiedDate; private String phoneNumber; @Email private String emailAddress; // getters & setters } My question is if there's a possible solution to serializing/deserializing other than wrapping the Branch into another class (e.g.