如何解决选项输入字段上的“扩展验证错误”?

时间:2019-04-05 10:07:29

标签: json azure-devops-extensions

我正在为Azure DevOps创建自定义扩展,在其中我需要pickList作为输入之一,当我将其上传到市场时,我在选项字段上总是得到Extension validation error

该错误的描述是:

无法反序列化贡献FlownTestBundler的task.json。错误转换值“ @ {Create或Update Resource Group =创建或更新资源组;选择Resource Group =配置虚拟机部署选项; Start =启动虚拟机;停止=停止虚拟机; StopWithDeallocate =停止并取消分配虚拟机;重新启动=重新启动虚拟机;删除=删除虚拟机;删除RG =删除资源组}“以键入'System.Collections.Generic.Dictionary`2 [System.String,System 。串]'。路径“ inputs [0] .options”,第31行,位置384。

我以https://github.com/Microsoft/azure-pipelines-tasks/blob/master/Tasks/AzureResourceGroupDeploymentV2/task.json为例。

当我的自定义版本因错误而失败时,我尝试完全删除失败的配置,并将示例中的输入字段粘贴到扩展程序中,但是我收到相同的错误。

我想使用的版本是:

"inputs": [
    {
      "name": "command",
      "type": "pickList",
      "label": "Command",
      "defaultValue": "SIT",
      "required": true,
      "helpMarkDown": "The command to run in the bundler",
      "options": {
        "SIT": "SIT",
        "SST": "SST"
      }
    }]

当那行不通时,我尝试了:

"inputs": [
{
    "name": "action",
    "type": "pickList",
    "label": "Action",
    "defaultValue": "Create Or Update Resource Group",
    "required": true,
    "helpMarkDown": "Action to be performed on the Azure resources or resource group.",
    "options": {
        "Create Or Update Resource Group": "Create or update resource group",
        "Select Resource Group": "Configure virtual machine deployment options",
        "Start": "Start virtual machines",
        "Stop": "Stop virtual machines",
        "StopWithDeallocate": "Stop and deallocate virtual machines",
        "Restart": "Restart virtual machines",
        "Delete": "Delete virtual machines",
        "DeleteRG": "Delete resource group"
    }
}]

至少在Microsoft版本的字段中,我希望通过验证。

0 个答案:

没有答案