amar1104
08/05/2024, 2:37 PM{
"request": {
"method": "GET",
"urlPathTemplate": "/api/user/{username}"
},
"response": {
"status": 200,
"headers": {
"Content-Type": "application/json"
},
"body": "<template>",
"transformers": [
"response-template"
]
}
}
In the above stub if the body template can read users from a file users.json iterate through the list of users and match path param agains the user.username and return it as response?
We can achieve this using custom extensions but would like to know if there is a straightforward way of doing it. TIATom
08/05/2024, 4:22 PMbodyFileName
field and therefore e.g. have a different body file per value of your {username}
parameter.Tom
08/05/2024, 4:23 PMbody
you’d have "bodyFileName": "user-{{request.path.user}}.json"
amar1104
08/05/2024, 7:56 PM// <http://localhost:8080/api/users?firstName=John>
{
"request": {
"method": "GET",
"url": "/api/users"
},
"response": {
"status": 200,
"headers": {
"Content-Type": "application/json"
},
"body": "<template>",
"transformers": ["response-template"]
}
}
Tom
08/06/2024, 8:50 AMamar1104
08/06/2024, 9:13 AMTom
08/06/2024, 9:17 AMTom
08/06/2024, 9:17 AMamar1104
08/06/2024, 9:27 AMTom
08/06/2024, 9:27 AMamar1104
08/06/2024, 9:43 AMTom
08/06/2024, 9:54 AMamar1104
08/06/2024, 10:00 AMTom
08/06/2024, 10:01 AMamar1104
08/06/2024, 10:04 AM