There is currently no way to add an element to an existing array. While in the future we might want to add a push() method that would work with only arrays and validate the path more strictly, this gets us what we need without much bloat on the RootedJsonData class.
See RootedJsonDatatTest::testAdd() for a working example of appending a string to an existing string of values.
There is currently no way to add an element to an existing array. While in the future we might want to add a
push()
method that would work with only arrays and validate the path more strictly, this gets us what we need without much bloat on the RootedJsonData class.See
RootedJsonDatatTest::testAdd()
for a working example of appending a string to an existing string of values.See
JsonPath\JsonObject::add()
for the original function being wrapped here.