0

サーバーからの私の JSON 応答はユーザー入力として変更されます。ユーザーが 1 つの項目を追加したときにサーバー上で応答を受け取ったとしますが、項目が 1 を超える場合、応答は JSONArray 形式です。

アプリケーションが強制終了されないようにこれらの応答を処理するには、チェックポイントを使用する必要がありますか?

二品の場合は..

"items":{
     "item":[ 
          {
           "item_id":"49623",
           "type":"Products",
           "name":"desktop app",
           "description":"",
           "unit_cost":"162.45",
           "quantity":"1.00",
           "discount":"0.00",
           "discount_type":"Percent",
           "tax1_percent":"0.00",
           "tax2_percent":"0.00"

        },
        {
           "item_id":"52851",
           "type":"Products",
           "name":"",
           "description":"",
           "unit_cost":"5,290.50",
           "quantity":"1.00",
           "discount":"0.00",
           "discount_type":"Percent",
           "tax1_name":{

           },
           "tax1_percent":"0.00",
           "tax1_type":{

           },
           "tax2_name":{

           },
           "tax2_percent":"0.00",
           "tax2_type":{

           }
        }

] }

単品の場合

"items":{
     "item":{
               "item_id":"49623",
                "type":"Products",
                 "name":"desktop app",
        "description":"this  is the software for your desktop system sequerty",
        "unit_cost":"162.45",
        "quantity":"1.00",
        "discount":"0.00",
        "discount_type":"Percent",
        "tax1_name":{

        },
        "tax1_percent":"0.00",
        "tax1_type":{

        },
        "tax2_name":{

        },
        "tax2_percent":"0.00",
        "tax2_type":{

        }
     }

} }

4

1 に答える 1