[{"id":"02afd225-87f7-4f6d-8be1-0a303c8beade","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"924e5c0c-0717-4fae-9bbc-0b496941985e","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"58e7444a-12e4-4161-81db-0bb54d09eca9","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"7919ac2f-121b-447c-82ed-15d13b45df0b","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"081f453a-0e9a-4f06-a70b-18085a1f0d81","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"1d01b943-eac8-480b-8d85-19bd093c8b3d","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"c1228456-1b5c-429d-b231-25c10a2b41cc","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"1f4d1309-e22c-413f-848d-2c0ca8450b0e","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"8ed468db-93ce-4cb3-8e2b-3249d9d464a7","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"70ce0595-eb94-4eb3-84f6-3a89ab8a4409","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"de70365b-d7c6-4355-a59b-3e77a6a374ae","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"4169f34f-3e9b-45c1-91bf-41c02c3ad5a4","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"8040235f-6c53-447e-a7f0-4fe5911e066b","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"6e9decb7-47f3-4871-81b9-65504bc293f1","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"f70c6c85-addd-43e7-8e2b-69dfe4a0a2fd","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"66d78fb1-e833-4bbf-ac7c-6bdfce9a80b0","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"f3e379ff-ca52-44d8-a15e-966f89904220","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"2c1d8bf8-2b69-4b16-bac9-9c46901abb6a","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"80633614-e86b-4b0b-9129-9f7acab69f6d","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"1029bbcc-399c-42e6-b412-a0437395d2d5","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"7e6097ce-e53b-416c-89c8-a3708db50528","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"1aaae15a-3496-43eb-a681-b077034832e4","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"ed5ad6f1-f5a2-47b8-a915-b185e8471ca3","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"7a454c88-860a-4e28-b52c-b18bae07dfe8","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"6b7d135b-71b4-4af7-828c-b28bf70b8ec7","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"e6cb5248-c20b-4d3e-adaf-b5c547e29548","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"5937193e-fd56-4296-8e32-ba41dba8e564","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"836dcc3b-2afe-4351-bf9f-bd9e2b0c8510","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"411aa66d-8df8-4466-896a-d8de68cf7066","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"7fc8dcfc-27ff-4496-96c2-d92dfe1fb4b2","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"3d1b1e48-357c-4999-985c-d9422356690a","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"58695f0f-7cb8-4bad-b617-dda90b01f606","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"22646924-f1ae-4a94-ac8e-e3e8ea2931f2","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"a042f416-d318-415c-b294-ed88a5010572","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"63b1ec03-c852-40ec-860e-f025c5791091","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"0610b0d6-03c7-461b-9dd4-f8d1b1787e7c","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"827318c4-10fd-462b-aa96-fab2cff174a9","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"8f626f70-8570-4934-a0e5-fc0ca6584738","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]}]
        
(Showing Draft Content)

JSONスキーマの使用

パブリックスキーマは、Spread.Sheets JSONデータ形式を記述します。また、人間にもマシンにも可読な文書を作成できるように、Spread.Sheets JSONデータを明確化します。完全な構造検証が可能であり、Spread.Sheets JSONデータおよびコードの生成、自動テスト、およびJSONデータの検証に便利です。スキーマの完全なリストについては、「Spreadスキーマ」を参照してください。

JSONスキーマの詳細については、json-schema.orgのWebサイトを参照してください。

JSONスキーマドキュメントを使用して、JSONデータが有効かどうかを検証できます。JSONスキーマに基づき、有効なJSONデータを作成することもできます。

次に、基本的なJSONスキーマの例を示します。

{
       "title": "LineBorder",
       "description": "Indicates the color of the border line. Use a known color name or HEX style color value. The default value is black.",
       "type": "object",
       "properties": {
         "color": {
           "type": "string",
           "default": "black"
         },
         "style": {
           "$ref": "#/definitions/LineStyle",
           "default": 0
         }
       }
     }

テーマを使用してバリデータを作成する方法については、こちらのWebサイト(http://json-schema.org/implementations.html)を参照してください。また、https://json-schema-validator.herokuapp.comで公開されているオンラインバリデータを使用すると、JSONスキーマドキュメントに基づき、作成したJSONデータを検証できます。

Spread.Sheets JSONスキーマドキュメントを使用すると、SpreadJS JSONデータを検証できます。

json-schema-validatorを使用してSpread.Sheets JSONデータを検証する手順は、次のとおりです。

  1. 部分的なJSONデータを検証します。

    a. たとえば、「NameInfo」に基づく2つのJSONデータがあり、両方とも有効なJSONデータであるかどうかを調べたいとします。

    {
        "name":"name1",
        "row":4,
        "column":3,
        "formula":"=SUM(A1,A3)"
    }
    {
     "name":"name1",
         "row":"4",
         "column":3,
         "formula":"=SUM(A1,A3)"
     }

    この場合は、次のような「NameInfo」JSONスキーマドキュメントを取得できます。

    {
           "title": "NameInfo",
           "description": "Represents a custom named expression that can be used by formulas.",
           "type": "object",
           "properties": {
             "name": {
               "type": "string"
             },
             "row": {
               "type": "integer",
               "minimum": 0
             },
             "col": {
               "type": "integer",
               "minimum": 0
             },
             "formula": {
               "type": "string"
             }
           }
         }

    JSONスキーマを使用して、JSONデータを検証します。「jsonData2」は無効です。本来、このrowプロパティの型は「number」ではなく「integer」であるべきです。


    b. JSONスキーマが別のJSONスキーマを参照している場合です。たとえば、次のJSONスキーマは、「LineStyle」という別のJSONスキーマを参照しています。

    {
        "title" : "LineBorder",
        "description" : "Indicates the color of the border line. Use a known color name or HEX style color value. The default value is black.",
        "type" : "object",
        "properties" : {
            "color" : {
                "type" : "string",
                "default" : "black"
            },
            "style" : {
                "$ref" : "#/definitions/LineStyle",
                "default" : "LineStyle.empty"
            }
        }
    }

    「LineBorder」のJSONデータを検証するには、完全な「LineBorder」JSONスキーマを使用します。

     {
        "title" : "LineBorder",
        "description" : "Indicates the color of the border line. Use a known color name or HEX style color value. The default value is black.",
        "type" : "object",
        "properties" : {
            "color" : {
                "type" : "string",
                "default" : "black"
            },
            "style" : {
                "$ref" : "#/definitions/LineStyle",
                "default" : "LineStyle.empty"
            }
        },
        "definitions":{
            "LineStyle":{
               "title":"LineStyle",
               "description":"Specifies the line drawing style for the border. empty:0,thin:1,medium:2,dashed:3,dotted:4,thick:5,double:6,hair:7,mediumDashed:8,dashDot:9,mediumDashDot:10,dashDotDot:11,mediumDashDotDot:12,slantedDashDot:13.",
               "enum":[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
            }
        }
    }
  2. 完全なJSONデータを検証します。完全バージョンのJSONスキーマを使用することで、Spread.Sheetsの完全バージョンのJSONデータを検証できます。