读取目录当前字段定义,不能用来修改字段
GET/api/v1/catalogs/{id}/schema
| 认证 | 不需要登录,如果带了访问令牌但令牌无效,请求会被拒绝 |
|---|---|
| 权限 | 无 |
路径参数
path
idstring必填目录 ID
路径示例
/api/v1/catalogs/cat_example/schema响应
200
application/json
成功时 code 为 200,资源在 data
catalog_idstring必填目录 ID
currencystring必填目录货币
schema_revisioninteger必填字段定义版本
system_fieldsstring[]必填不能当作自定义字段 key 的系统名
fieldsobject[]必填当前字段定义
fields[].idstring必填字段 ID
fields[].keystring必填字段 key,创建后不能改
fields[].labelstring必填显示名
fields[].typeenum<string>必填字段类型
可选值: textnumberbooleansingle-select
fields[].requiredboolean必填是否必填
fields[].choicesstring[]必填单选可选项,其它类型为空
fields[].statusstring必填字段状态,含停用
响应示例
{
"catalog_id": "cat_example",
"currency": "CNY",
"schema_revision": 1,
"system_fields": [
"string"
],
"fields": [
{
"id": "id_example",
"key": "weight_g",
"label": "示例",
"type": "text",
"required": true,
"choices": [
"string"
],
"status": "string"
}
]
}