I want to filter my json data based on my request. so if my request is like /user
it gives me the full json data as result and if i give /user?bikes
it filters me the result with json result with bike data and if i use /user?cars
it filters me json data with car as result. Below is my json payload .
{
"name": "John",
"age": 30,
"cars": {
"car1": "Ford",
"car2": "BMW",
"car3": "Fiat"
},
"bikes": {
"bike1": "ducati",
"bike2": "BMW",
"bike3": "honda"
}
}
so /user
will give full data
/user?bikes
will be -
{
"bikes": {
"bike1": "ducati",
"bike2": "BMW",
"bike3": "honda"
}
}
/user?cars
will be -
{
"cars": {
"car1": "Ford",
"car2": "BMW",
"car3": "Fiat"
}
}
Please let me know how this can be used using mulesoft