Can I refer to one json object in another object in the same json file?

前端 未结 1 534
野趣味
野趣味 2021-01-22 05:41

I\'m trying to develop a test automation framework using json to describe data. I have a json file which looks like this:

{
  \"preparation\":{
    \"configurat         


        
相关标签:
1条回答
  • 2021-01-22 06:33

    No, you can't do that, at least not directly. For a start, JSON doesn't support circular references.

    You might consider using a library such as jsonpath that allows you to reference elements by pattern, but you would tend to need apriori whether a value was an actual value or a reference to some other branch.

    0 讨论(0)
提交回复
热议问题