Json Path syntax for response-transformer


#1

Good morning all,

We are working with Kong 1.1rc1-centos (Docker version) and are trying to modify the following response:

{
“globalparameter”: {
“parameterName1”: “newaccount”,
“parameterValue1”: “T1n5Mb38p1”,
“parameterOperator1”: “equals”,
“parameterName2”: “contentReviewerGroupCode”,
“parameterValue2”: “ACCT”,
“parameterOperator2”: “equals”,
“parameterName3”: “documentDate”,
“parameterValue3”: “2017-08-07|2019-02-07”,
“parameterOperator3”: “range” }
}

The modification is to remove parameterOperator3 so we end up with this json:

{
“globalparameter”: {
“parameterName1”: “newaccount”,
“parameterValue1”: “T1n5Mb38p1”,
“parameterOperator1”: “equals”,
“parameterName2”: “contentReviewerGroupCode”,
“parameterValue2”: “ACCT”,
“parameterOperator2”: “equals”,
“parameterName3”: “documentDate”,
“parameterValue3”: “2017-08-07|2019-02-07” }
}

Among many tries, we are using this:

curl -X POST http://localhost:8001/routes/route-service2/plugins
–header ‘Content-Type: application/json; v=1’
–data “name=response-transformer”
–data “config.remove.json=globalparameter.parameterOperator3”

Unfortunately this doesn’t remove anything. If I just use ‘globalparameter’ instead of ‘globalparameter.parameterOperator3’, then the whole json gets emptied out. Anyone can either help or point me to the correct documentation for the syntax?

Thanks

Nic

Note: Here is what I tried so far
–data “config.remove.json=globalparameter[].parameterOperator3”
–data “config.remove.json=globalparameter[parameterOperator3]”
–data “config.remove.json=globalparameter.parameterOperator3:range”
–data “config.remove.json=globalparameter.parameterOperator3[]:range”
–data “config.remove.json=globalparameter[parameterOperator3]:range”
–data “config.remove.json=parameterOperator3”
–data “config.remove.json=parameterOperator3:range”
–data “config.remove.json=searchParameters1[parameterOperator3]:range"
etc…


#2

Am I the only one with this issue?