github.com/dbernstein1/tyk@v2.9.0-beta9-dl-apic+incompatible/apps/jq.json (about) 1 { 2 "name": "JQ Transform test API", 3 "api_id": "4", 4 "org_id": "default", 5 "definition": { 6 "location": "", 7 "key": "" 8 }, 9 "use_keyless": true, 10 "auth": { 11 "auth_header_name": "" 12 }, 13 "enable_context_vars": true, 14 "version_data": { 15 "not_versioned": true, 16 "versions": { 17 "Default": { 18 "name": "Default", 19 "expires": "3000-01-02 15:04", 20 "use_extended_paths": true, 21 "extended_paths": { 22 "ignored": [], 23 "white_list": [], 24 "black_list": [], 25 "transform_jq": [{ 26 "path": "/post", 27 "method": "POST", 28 "filter": "{\"body\": (.body + {\"TRANSFORMED-REQUEST-BY-JQ\": true, path: ._tyk_context.path, user_agent: ._tyk_context.headers_User_Agent}), \"rewrite_headers\": {\"X-added-rewrite-headers\": \"test\"}, \"tyk_context\": {\"m2m_origin\": \"CSE3219/C9886\", \"deviceid\": .body.DEVICEID}}" 29 }], 30 "transform_headers": [ 31 { 32 "path": "/post", 33 "method": "POST", 34 "add_headers": {"X-added-by-transform_headers": "$tyk_context.deviceid", 35 "X-M2M-Origin": "$tyk_context.m2m_origin"} 36 } 37 ], 38 "transform_jq_response": [{ 39 "path": "/post", 40 "method": "POST", 41 "filter": "{\"body\": (.body + {\"TRANSFORMED-RESPONSE-BY-JQ\": true, \"HEADERS-OF-RESPONSE\": .response_headers}), \"rewrite_headers\": {\"JQ-Response-header\": .body.origin}}" 42 }] 43 } 44 } 45 } 46 }, 47 "proxy": { 48 "listen_path": "/jq/", 49 "target_url": "http://httpbin.org/", 50 "strip_listen_path": true 51 }, 52 "do_not_track": true, 53 54 "response_processors": [ 55 { "name": "response_body_transform_jq", "options": {}} 56 ] 57 }