APITable Docs
配置管理二次开发如何快速上下架机器人Action

Action's JsonShema

InputJsonSchema

声明机器人 action 输入的数据结构和页面结构。

细节

例子

  • {"schema": {"type": "object", "required": ["account", "password"], "properties": {"account": {"type": "string", "title": "账号"}, "password": {"type": "string", "title": "密码"}}}, "uiSchema": {"ui:order": ["account", "password"]}}

OutputJsonSchema

声明机器人 action 输出的数据结构和页面结构。

细节

例子

  • {"schema": {"type": "object", "required": ["message"], "properties": {"message": {"type": "string", "title": "action执行结果"}}}, "uiSchema": { "ui:order": ["message"]}

JsonSchema

我们通过它定义机器人action 输入输出的数据结构和页面结构。

细节

  • Type: object

属性

KeyRequiredTypeDescription
schemayesSchema声明 action 输入输出的数据结构。
uiSchemayesUiSchema声明 action 输入输出的页面结构。

例子

  • {"schema": {"type": "object", "required": ["account", "password" ], "properties": {"account": { "type": "string", "title": "账号"}, "password": {"type": "string", "title": "密码"}}}, "uiSchema": {"ui:order": ["account", "password"]}}
  • {"schema": {"type": "object", "required": ["message"], "properties": {"message": {"type": "string", "title": "action执行结果"}}}, "uiSchema": { "ui:order": ["message"]}

Schema

声明 action 输入输出的数据结构。

细节

  • Type: object

属性

KeyRequiredTypeDescription
typeyesstring in ('object')此键值对固定。
propertiesyesPropertiesSchema声明 action 输入输出数据结构的属性。
requirednoarray声明 action 输入输出值必须存在的属性的键。

例子

  • {"type": "object", "required": ["account", "password" ], "properties": { "account": {"type": "string", "title": "账号" }, "password": {"type": "string", "title": "密码"}}
  • {"type": "object", "required": ["fruit"], "properties": {"fruit": { "type": "string", "title": "水果", "enum": ["苹果", "梨", "橙子"], "default": "苹果" }}}

PropertiesSchema

声明 action 输入输出数据结构的属性。

细节

  • Type: object

属性

KeyRequiredTypeDescription
[^\s]+noPropertySchema键需要是字符串。

例子

  • {"account": {"type": "string", "title": "账号" }, "password": {"type": "string", "title": "密码"}}
  • {"fruit": {"type": "string", "title": "水果", "enum": ["苹果", "梨", "橙子"], "default": "苹果" }}

PropertySchema

声明属性的信息。

细节

  • Type: object

属性

KeyRequiredTypeDescription
typeyesstring in ('string', 'array', 'object')属性类型
titleyesstring属性的名称
descriptionnostring属性的描述
enumnoarray当属性类型为 string 时,可以指定取值
defaultnostring当属性类型为 string 时,可以指定默认值

例子

  • {"type": "string", "title": "账号"}
  • {"type": "string", "title": "水果", "enum": ["苹果", "梨", "橙子"], "default": "苹果"}

UiSchema

用于声明 JSON 数据的界面的对象。

细节

Type: object

属性

KeyRequiredTypeDescription
ui
noarray指定属性在界面上显示的顺序。
key of PropertiesSchema键取值为属性键。

例子

  • {"ui:order": [ "account", "password"]}

SubUiSchema

指定某个属性的 ui 样式。

细节

Type: object

属性

KeyRequiredTypeDescription
ui
noUiOptions指定渲染属性时的一些样式。
ui
nostring指定用于渲染属性的组件的名称。
ui
noarray指定属性组件在页面上显示的顺序。
key of PropertiesSchemanoSubUiSchema键取值为属性键。

UiOptions

指定渲染属性时的一些样式。

细节

Type: object

属性

KeyRequiredTypeDescription
showTitlenoboolean是否显示标题

On this page