rest-assured/src/main/java/io/restassured/builder/ResponseSpecBuilder.java
public ResponseSpecBuilder appendRootPath(String pathToAppend, List<Argument> arguments) {
        spec.appendRootPath(pathToAppend, arguments);
        return this;
    }
public ResponseSpecBuilder appendRootPath(String pathToAppend, List<Argument> arguments) {
        spec.appendRootPath(pathToAppend, arguments);
        return this;
    }
Append the given path to the root path with arguments supplied of the response body so that you don't need to write the entire path for each expectation.
This is mainly useful when you have parts of the path defined in variables.
E.g. instead of writing:
<p/>
<pre>
String namePath = "name";
expect().
root("x.y").
body("age", is(..)).
body("gender", is(..)).
body(namePath + "first", is(..)).
body(namePath + "last", is(..)).
when().
get(..);
</pre>
<p/>
you can use a append root and do:
<pre>
String namePath = "name";
expect().
root("x.y").
body("age", is(..)).
body("gender", is(..)).
appendRoot("%s", withArgs(namePath)).
body("first", is(..)).
body("last", is(..)).
when().
get(..);
</pre>

@param pathToAppend The root path to use. The path and arguments follows the standard <a href="http://download.oracle.com/javase/1,5.0/docs/api/java/util/Formatter.html#syntax">formatting syntax</a> of Java.