Index value of Array

前端 未结 7 1607
眼角桃花
眼角桃花 2021-01-12 08:56

I have a json file with contents like this:

{
     \"aaa\":{
         \"status\":\"available\",
         \"classkey\":\"dotnet\"
     },
     \"bbb\":{
              


        
7条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-12 09:24

    For the sake of providing an answer to the question title, here is the array structure that would serve the original purpose:

    [
         {
             "status":"available",
             "classkey":"dotnet"
         },
         {
             "ccc":{
                 "com":"available",
                 "net":"available",
                 "info":"available",
                 "org":"available"
              }
         }
    ]
    

    So just replace the outmost brackets with [] to get an array instead of an object. Here is a demo. See http://www.json.org/ and http://www.json.com/.

提交回复
热议问题