I am a first time TFS/VSTS extension developer. My Current task is to build a simple VSTS Build task.
We have a self made web API containing product information, but I am stuck in source binding. Found information about using the endpoint service, but my picklist aren't populated.
What i have so far:
Task.Json
"inputs": [
{
"name": "APIURL",
"type": "connectedService:Generic",
"label": "API URL",
"required": true,
"GroupName": "WebAPIsettings",
"helpMarkDown": ""
},
{
"name": "List1",
"type": "pickList",
"label": "List1",
"defaultValue": "",
"required": true,
"GroupName": "WebAPIsettings",
"helpMarkDown": ""
},
{
"name": "List2",
"type": "pickList",
"label": "List2",
"defaultValue": "",
"required": true,
"GroupName": "WebAPIsettings",
"helpMarkDown": ""
}]
,"sourceDefinitions": [
{
"target": "List1",
"endpoint": "/api/data/get",
"selector": "jsonpath:$.[Code]",
"authKey": "$(APIURL)"
},
{
"target": "List2",
"endpoint": "/api/data/get",
"selector": "jsonpath:$.[ID]",
"authKey": "$(APIURL)"
}]
I've created an generic endpoint that points towards the API (http://sample.api.local)
Both list1 and list2 are not populated after selecting the endpoint, so i'm missing something.
I've tested my API json output with http://jsonpath.com/
JSON test data:
[{"Code":"0344","ID":"version1"},
{"Code":"0363","ID":"version2"},
{"Code":"0518","ID":"version3"},
{"Code":"0599","ID":"version4"}]
What am I missing?
See Question&Answers more detail:
os