Greetings everyone,
I am interested in creating a unique JSON script that has the capability for objects to either retrieve a value or navigate through a data path.
For instance:
{
"A" : {
"B" : "123"
}
}
In the given example, when I access the value of A.B, it returns 123. However, I also want A to possess its own distinct value, such as "XYZ".
Therefore, when I inquire about what A is, it should return "XYZ", and if I ask about A.B, it should return "123".
I hope this explanation is clear; typically, JSON operates on a singular path, yet I desire the ability to traverse the path and allocate values to individual nodes. It's akin to each node having both a value and relationships with children and parents.
Any insights into this concept would be highly appreciated.