Say you have a JSON entity like this:
{
"meta": {
"created_at": "2024-06-25T11:56:42Z",
"updated_at": "2024-07-12T15:32:24Z",
"created_by": "theory",
"updated_by": "strongrrl"
},
"contact": {
"emails": [
{ "type": "work", "email": "[email protected]" },
{ "type": "home", "email": "[email protected]" }
],
"phones": [
{ "type": "work", "phone": "+1-312-555-1212" },
{ "type": "home", "phone": "+1-312-555-2121" }
]
},
"profile": {
"name": "Barrack Obama",
"title": "Former POTUS",
"org": "The Obama Foundation",
"ssn": "123-45-6789"
}
}
And you have an employee who's entitled to look at some but not all of the entity. Perhaps their permissions limit them to metadata dates, email addresses, name, and employer. The resulting entity presented to the employee would be:
{
"meta": {
"created_at": "2024-06-25T11:56:42Z",
"updated_at": "2024-07-12T15:32:24Z"
},
"contact": {
"emails": [
{ "type": "work", "email": "[email protected]" }
]
},
"profile": {
"name": "Barrack Obama",
"org": "The Obama Foundation"
}
}
Is there some sort of object selector/json selector language or pattern for this? JSONPath is great but only allows a single path, not multiple selects.
That…is a very long RFC!