You need another POJO that represents a "CustomFields". For example:

public class CustomFields {
     private String Id;
     private String Name;
     private String Value;

     <getters and setters>
}

and use List<CustomFields> CustomFields instead of String[] customFields. Also note that your JSON example doesn't use camel case for the property names so your POJO shouldn't use camel case either.

There are ways to avoid using a POJO at all in REST Assured. You can for example use a HashMap instead which could be easier in some situations.

Answer from Johan on Stack Overflow
๐ŸŒ
GroTechMinds
grotechminds.com โ€บ home โ€บ creating and using pojo classes in restassured for api testing
Creating and Using POJO Classes in RestAssured for API Testing
February 27, 2025 - We have to serialize the value ... The ObjectMapper class belongs to the Jackson data-bind package. It provides functionality for reading and writing JSON, either to and from basic POJOs (Plain Old Java 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 - For effective testing using Rest ... Letโ€™s start by creating a simple POJO class that represents the structure of the data we expect to send or receive from the API....
๐ŸŒ
Medium
medium.com โ€บ @nabin.ghosh11 โ€บ de-serialization-using-pojo-classes-and-lombok-in-rest-assured-6db9916ea9d6
De-serialization using POJO Classes and Lombok in Rest Assured | by Nabin Ghosh | Medium
August 23, 2020 - We will also leverage Lombok in the de-serialization process. The first part of the post will show how to convert the API response to POJO (Plain Old Java Object) class using Jackson as the object mapper. Jackson needs to be set in the classpath.
๐ŸŒ
Makeseleniumeasy
makeseleniumeasy.com โ€บ 2020 โ€บ 06 โ€บ 08 โ€บ rest-assured-tutorial-29-how-to-create-pojo-classes-of-a-json-payload
REST Assured Tutorial 29 โ€“ How to create POJO classes of a JSON Object Payload
We will create a JSON object form POJO and vice versa now which is generally called as serialization and deserialization using Jackson APIs. Do not worry about the terms serialization and deserialization as of now as I have not covered it yet. For time being, you just know :- serialization โ€“ Convert Employee class object to JSON representation or Object ยท deserialization โ€“ reverse of serializing . Convert a JSON Object to Employee class object ยท package RestfulBookerPojo; import org.testng.annotations.Test; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.j
๐ŸŒ
Medium
blog.nonstopio.com โ€บ serialization-and-deserialization-in-rest-assured-api-testing-371c467edc7e
Serialization and Deserialization in Rest-assured API Testing. | by Kishor Munot | nonstopio
September 4, 2025 - We can create a Class โ€œEmployeeโ€ ( We can give any meaningful name) and to store employee-related data we can declare fields or variables in this class. We also need to retrieve and manipulate data so we need to define some mechanism or ...
๐ŸŒ
On Test Automation
ontestautomation.com โ€บ deserializing-pojos-in-rest-assured
(De)serializing POJOs in REST Assured | On Test Automation
October 5, 2016 - In this post, Iโ€™d like to demonstrate how you can leverage the ability of REST Assured to (de-)serialize Plain Old Java Objects (better known as POJOs) for more powerful testing. As an example, weโ€™ll use the following POJO representing a car and some of its properties: public class Car { String make; String model; int year; public Car() { } public Car(String make, String model, int year) { this.make = make; this.model = model; this.year = year; } public String getMake() { return this.make; } public void setMake(String make) { this.make = make; } public String toString() { return "My car is a " + this.year + " " + this.make + " " + this.model; } }
๐ŸŒ
Medium
medium.com โ€บ @deshmane.neelam โ€บ serialization-and-deserialization-using-pojo-classes-in-rest-assured-91d3b10b1779
Serialization and deserialization using POJO classes in Rest Assured | by Deshmane Neelam | Medium
November 28, 2022 - Next, we need to map JSON response with above created POJO class. This can be achieved by using AS() function. As() function needs class name as an argument and maps response body to Java object. Rest all will be taken care by Rest Assured.
Find elsewhere
๐ŸŒ
LinkedIn
linkedin.com โ€บ pulse โ€บ rest-assured-serialisation-de-serialisation-subodh-kumar-singh
Rest Assured : Serialisation and De-Serialisation
And using deserialisation REST ... consumed by client. ... โ€ŽPOJO is a simple data structure that has private fields with public getter and setter, but it does not have business implementation....
๐ŸŒ
Medium
medium.com โ€บ @akshaymulay27 โ€บ pojo-objectmapper-in-rest-assured-the-easiest-guide-for-api-testers-with-real-examples-e1a91b893cb4
POJO & ObjectMapper in Rest Assured: The Easiest Guide for API Testers (With Real Examples) | by Akshay Mulay | Medium
May 8, 2025 - ๐Ÿ’ก User.class tells Java what type of object it should create from the JSON string. The cool part? Rest Assured can do all this automatically using your POJO class.
๐ŸŒ
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
๐ŸŒ
Techndeck
techndeck.com โ€บ serialization-and-de-serialization-using-rest-assured
Serialization and Deserialization using Rest Assured - Techndeck
April 9, 2022 - As Iโ€™ve mentioned this line above โ€œin the form of the object instanceโ€, it means we need to create a sample object instance of Student (POJO) class and specify some values to it.
๐ŸŒ
TOOLSQA
toolsqa.com โ€บ rest-assured โ€บ deserialize-json-response
Deserialize JSON Response using Rest Assured
February 12, 2022 - For this, we need two POJO classes one each for success and failure. Depending on the value of the Status code we can call instances of the appropriate class and deserialize the response.
๐ŸŒ
To The New
tothenew.com โ€บ home โ€บ pojo implementation in api testing (automation) using rest assured
POJO implementation in API testing (Automation) using Rest Assured | TO THE NEW Blog
September 22, 2025 - { // Import Statements for this Test class import org.testng.Assert; import org.testng.annotations.Test; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import io.restassured.RestAssured; import io.restassured.http.ContentType; import io.restassured.response.Response; import io.restassured.specification.RequestSpecification;
๐ŸŒ
Applitools
testautomationu.applitools.com โ€บ automating-your-api-tests-with-rest-assured โ€บ chapter6.html
Chapter 6 - (De-) Serialization of Java Objects in REST Assured Tests
These are the most straightforward type of Java classes there are, consisting of properties or fields, and methods that you can use to access and modify the values of those properties.
๐ŸŒ
YouTube
youtube.com โ€บ the testing academy
JSON to POJO Rest Assured | Deserializing JSON response to POJO class in RestAssured | Session 19 - YouTube
In this video, we are going to convert the JSON to POJO rest assured.https://www.jsonschema2pojo.org/#restassured #testautomation #apitesting #frameworkJoin ...
Published ย  June 18, 2021
Views ย  4K