I have created RAML and example JSON file inside Anypoint platform and have generated flow using RAML file that is the APIKit router. Here is my RAML file content:
#%RAML 0.8
---
title: TestEmployee API
version: v1
/employee:
get:
queryParameters:
id:
displayName: Employee id
required: true
name:
displayName: Employee name
required: false
responses:
200:
body:
application/json:
example: !include EmployeeExample.json
And example JSON is:
[{
"id": 1,
"name":"Charles",
"code": "C1ENU00",
"dateofjoining":"2019/06/24",
"domain":"ENU",
"address":"Hyderabad",
"phone": 9865458936,
"program": "WASE"
},
{
"id": 2,
"name":"John",
"code": "C2DIG00",
"dateofjoining":"2019/06/24",
"domain":"DIGITAL",
"address":"Chennai",
"phone": 9756359864,
"program": "ELITE"
}
]
I want to use a Choice router to route messages according to the condition so that 'id' and 'name' from query parameters would give JSON responses containing that 'id' and 'name' only. Please guide me in creating appropriate flows and Dataweave expressions if any.