gpt4 book ai didi

azure - 值不能为空。\r\n参数名称 : inputParameters

转载 作者:行者123 更新时间:2023-12-02 07:56:42 24 4
gpt4 key购买 nike

在尝试使用 azure devops REST API 创建管道时,我收到“值不能为空。\r\n参数名称:inputParameters”。 Ø

任何人都可以建议 API 调用的请求正文参数应该是什么吗?

我的实现:

API CALL (POST) : https://dev.azure.com/{org}/{project}/_apis/pipelines?api-version=6.0-preview.1

Request Body:

{
"configuration": [
{
"type": "yaml",
"folder": "./",
"name": "trl-pipeline"
}
]
}

根据https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/create?view=azure-devops-rest-6.0

Response:

{
"$id": "1",
"innerException": null,
"message": "Value cannot be null.\r\nParameter name: inputParameters",
"typeName": "System.ArgumentNullException, mscorlib",
"typeKey": "ArgumentNullException",
"errorCode": 0,
"eventId": 0
}

最佳答案

请在您的请求正文中添加存储库 ID 和名称。这是我的示例:

1.我在我的 azure 存储库中创建了一个 yaml 文件。

enter image description here

2.我的请求正文如下所示:

POST https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=6.0-preview.1



{
"configuration":{
"path": "azure-pipelines.yml",
"repository":{
"id": "{repo id}",
"type": "azureReposGit",
"name": "{repo name}"
},
"type":"yaml"
},
"name":"PipelineName"
}

关于azure - 值不能为空。\r\n参数名称 : inputParameters,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64257812/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com