how can write condition 'if' type is no details other two fields are hide in json response. if possible i want to do it in pojo or bean ?
Using spring boot
- spring data rest and hal.
- pojo
- MongoDB Repository
I want to show accountNo and Accountdetails if type="details"
{
"Name":"Json",
"lastName":"Amazon",
"type":"Details",
"accountNo":"12123",
"AccountdetailsDetails":[ some details]
}
If type="noDetails" just show mentioned response.
{
"Name":"Json",
"lastName":"Amazon",
"type":"NoDetails"
}