I want to redirect below request
/student/{id}
to
xxx/registry/api/v1/Student/{id}
here is my json
{
“name”: “Student”,
“slug”: “test-api”,
“api_id”: “Student”,
“org_id”: “1”,
“use_keyless”:true,
“auth_configs”: {
“authToken”: {
“auth_header_name”: “Authorization”
}
},
“definition”: {
“location”: “header”,
“key”: “x-api-version”,
“response_processors”: [
{
“name”: “response_body_transform”,
“options”: {}
}
]
},
“version_data”: {
“not_versioned”: true,
“versions”: {
“Default”: {
“name”: “Default”,
“use_extended_paths”: true,
“extended_paths”: {
“ignored”: [],
“white_list”: [],
“black_list”: [],
“cache”: [“get”],
“transform”: [],
“transform_response”: [
{
“path”: “Student/{id}”,
“method”: “GET”,
“template_data”: {
“template_mode”: “file”,
“template_source”: “ewogICJpZCI6ICJ7ey52ZXJ9fSIKfQ==”,
“input_type”: “json”
}
}
],
“url_rewrites”: [{
“path”: “/student/{id}”,
“method”: “GET”,
“match_pattern”: “/(\w+)/(\w+)”,
“rewrite_to”: “xxxx/registry/api/v1/Student/$2”,
“triggers”: []
}],
"transform_headers": []
}
}
}
},
"proxy": {
"listen_path": "/student/{id}",
"target_url": "xxxx/registry/api/v1/Student/{id}",
"strip_listen_path": true
},
"active": true,
"response_processors": [
{
"name": "response_body_transform",
"options": {}
}
]
}
After hitting the url the id being passed to target url is incorrect. What is it that i am doing wrong here?