Request-Transformer plugin: output of config.add.body parameter are not in order

Summary

I’m using request-transformer to additional parameter. The additional parameters were added correctly, but not in input order. Please see below example:

Steps To Reproduce/Example

  1. ======service======
curl -i -X GET http://127.0.0.1:8001/services/mytest03

{"host":"mockbin.org","created_at":1590502418,"connect_timeout":2000,"id":"5d1c1404-bdae-43ac-a444-5acccb75bca7","protocol":"https","name":"mytest03","read_timeout":5000,"port":443,"path":"\/echo","updated_at":1590505900,"retries":5,"write_timeout":2000,"tags":[],"client_certificate":null}

  1. ======route======
curl -i -X GET http://127.0.0.1:8001/services/mytest03/routes

{"next":null,"data":[{"id":"7a4c680e-e3ab-4f99-9b57-b130a17baee6","path_handling":"v0","paths":["\/mapi"],"destinations":null,"headers":null,"protocols":["http","https"],"methods":null,"snis":null,"service":{"id":"5d1c1404-bdae-43ac-a444-5acccb75bca7"},"name":"myroute04","strip_path":true,"preserve_host":false,"regex_priority":0,"updated_at":1590505883,"sources":null,"hosts":null,"https_redirect_status_code":426,"tags":null,"created_at":1590505883}]}
  1. ======create plugins======
curl -i -X POST http://127.0.0.1:8001/routes/myroute04/plugins --data "name=request-transformer" --data "config.add.body=sign:F9D762CC" --data "config.add.body=appkey:01234" --data "config.add.body=method:test.shop.get" --data "config.add.body=sessionkey:f189910c"  --data "config.add.headers=content-type:application/json"

{"created_at":1590663859,"config":{"remove":{"querystring":[],"headers":[],"body":[]},"replace":{"querystring":[],"headers":[],"uri":null,"body":[]},"http_method":null,"add":{"querystring":[],"headers":["content-type:application\/json"],"body":["sign:F9D762CC","appkey:01234","method:test.shop.get","sessionkey:f189910c"]},"append":{"querystring":[],"headers":[],"body":[]},"rename":{"querystring":[],"headers":[],"body":[]}},"id":"63c10a4c-7c9a-48f9-a018-527ff71834c5","service":null,"enabled":true,"protocols":["grpc","grpcs","http","https"],"name":"request-transformer","consumer":null,"route":{"id":"7a4c680e-e3ab-4f99-9b57-b130a17baee6"},"tags":null}

Expectation/Result

  • After the creation, the result is:
curl -i -X GET http://127.0.0.1:8000/mapi

 {"method":"test.shop.get","sign":"F9D762CC","sessionkey":"f189910c","appkey":"01234"}

  • However, I would expect the below result (in same order as parameter input when plugin created)
 {"sign":"F9D762CC","appkey":"01234","method":"test.shop.get","sessionkey":"f189910c"}

Additional Details & Logs

Kong version: 2.0.0
OS: CentOS 8.0

Would you please advise any fix or solution?

Thanks.