我在看https://adaptivecards.io/ https://adaptivecards.io/对于我的聊天机器人。我看到我们可以创建任何类型的卡片,并且可以使用自适应 json 渲染 ui。但是我如何将自定义 json 转换为自适应卡片 json 格式。我是否需要根据我的自定义 json 响应类型手动转换,或者是否有任何方法可以将特定 json 转换为首选自适应卡。
adaptive card response:
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "What type of food do you prefer?",
"wrap": true
},
{
"type": "ImageSet",
"imageSize": "medium",
"images": [
{
"type": "Image",
"url": "https://contososcubademo.azurewebsites.net/assets/steak.jpg",
"size": "Medium"
},
{
"type": "Image",
"url": "https://contososcubademo.azurewebsites.net/assets/chicken.jpg",
"size": "Medium"
},
{
"type": "Image",
"url": "https://contososcubademo.azurewebsites.net/assets/tofu.jpg",
"size": "Medium"
}
]
}
]
}
json:
{
"title": "Publish Adaptive Card Schema",
"description": "Now that we have defined the main rules and features of the format, we need to produce a schema and publish it to GitHub. The schema will be the starting point of our reference documentation.",
"creator": {
"name": "Matt Hidinger",
"profileImage": "https://pbs.twimg.com/profile_images/3647943215/d7f12830b3c17a5a9e4afcc370e3a37e_400x400.jpeg"
},
"createdUtc": "2017-02-14T06:08:39Z",
"viewUrl": "https://adaptivecards.io",
"properties": [
{
"key": "Board",
"value": "Adaptive Cards"
},
{
"key": "List",
"value": "Backlog"
},
{
"key": "Assigned to",
"value": "Matt Hidinger"
},
{
"key": "Due date",
"value": "Not set"
}
]
}