Below is the code I am using
JSONObject requestParams = new JSONObject();
requestParams.put("something", "something value");
requestParams.put("another.child", "child value");
This is how the api needs to be posted
{
"something":"something value",
"another": {
"child": "child value"
}
}
I get an error stating that the
The another.child field is required.
How do I go about posting this via restAssured? The other APIs do not require posting with nesting work so I'm assuming that's why it's failing.
Consider
another
as Json object within the main Json object.This will print;
To pass this Json object to Rest Assured POST method;
Required imports;