レイアウトデータ

レイアウトデータは、JSON Schemaで定義した項目をどのwidgets(form部品)を使って処理するのかを定義するものです。

サンプル

サンプルで使うJSON Schema:

{
  "title": "Person",
  "type": "object",
  "properties": {
    "firstName": {
      "type": "string"
    },
    "lastName": {
      "type": "string"
    },
    "age": {
      "description": "Age in years",
      "type": "integer",
      "minimum": 0
    }
  },
  "required": [
    "firstName",
    "lastName"
  ]
}

レイアウトデータの定義例:

[
  {
    "type": "input",
    "key": "firstName",
    "title": "firstName"
  },
  {
    "type": "input",
    "key": "lastName",
    "title": "lastName"
  },
  {
    "type": "input",
    "key": "age",
    "title": "age"
  },
  {
    "type": "section",
    "direction": "row",
    "items": [
      {
        "type": "button",
        "title": "regist",
        "kind": "submit",
        "color": "primary"
      }
    ]
  }
]

レイアウトデータプロパティ

プロパティは、widgets(form部品)毎に異なります。ここでは共通の主要プロパティを説明します。

プロパティ 内容 備考
type widgetsの種別  
key JSON Schemaで定義された項目キー  
title 項目名 メッセージデータの定義項目名を設定する

注釈

各widgetsの詳細は、widgets仕様を参照してください。