I have a requirement to limit the attributes in a REST response to callers. Consider the answer in JSON format.
Example: for a given REST endpoint, the default response is similar to
{
"id" : "111"
"name" : "John"
"age" : "30"
}
For “Caller 1,” the answer should look like
{
"id" : "111"
"name" : "John"
"age" : "null"
}
For “Caller 2,” the answer should be similar to
{
"id" : "111"
"name" : "null"
"age" : "30"
}
In the JSONs answers above, “null” means that such attributes are not displayed to such callers.
I am looking for a way to implement to control the REST response to the caller.
source
share