<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 屬性值格式 **屬性值必須是Unicode 的 booleans(布爾), 數字(numbers), 字符串(strings), 對象(objects), 數組(arrays), 或 null.** JSON.org上的標準準確的說明了哪些類型的數據可以作為屬性值。這包含Unicode的布爾(booleans), 數字(numbers), 字符串(strings), 對象(objects), 數組(arrays), 或 null。JavaScript表達式是不被接受的。APIs應該支持該準則,并為某個特定的屬性選擇最合適的數據類型(比如,用numbers代表numbers等)。 好的例子: ~~~ { "canPigsFly": null, // null "areWeThereYet": false, // boolean "answerToLife": 42, // number "name": "Bart", // string "moreData": {}, // object "things": [] // array } ~~~ 不好的例子: ~~~ { "aVariableName": aVariableName, // Bad - JavaScript 標識符 "functionFoo": function() { return 1; } // Bad - JavaScript 函數 } ~~~ ## 空或Null 屬性值 **考慮移除空或null值** 如果一個屬性是可選的或者包含空值或_null_值,考慮從JSON中去掉該屬性,除非它的存在有很強的語義原因。 ~~~ { "volume": 10, // 即使 "balance" 屬性值是零, 它也應當被保留, // 因為 "0" 表示 "均衡" // "-1" 表示左傾斜和"+1" 表示右傾斜 "balance": 0, // "currentlyPlaying" 是null的時候可被移除 // "currentlyPlaying": null } ~~~ ## 枚舉值 **枚舉值應當以字符串的形式呈現** 隨著APIs的發展,枚舉值可能被添加,移除或者改變。將枚舉值當作字符串可以使下游用戶幽雅的處理枚舉值的變更。 Java代碼: ~~~ public enum Color { WHITE, BLACK, RED, YELLOW, BLUE } ~~~ JSON對象: ~~~ { "color": "WHITE" } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看