I'm hitting an endpoint with this data:
{
"Id": "variableset-Projects-922",
"Variables": [
{
"Id": "30bf54b6-2e07-100f-d9f4-26879b3e9462",
"Name": "test",
"Value": "blah blah",
"Description": null,
"Scope": {},
"IsEditable": true,
"Prompt": null,
"Type": "String",
"IsSensitive": false
}
]
}
Command: $spaces = Invoke-RestMethod -Method 'Get' -Uri $uri -Headers $header
Result: @{Id=variableset-Projects-922; Variables=System.Object[];}
Command: $response = Invoke-WebRequest -URI $uri -Headers $header -Method 'Get' -UseBasicParsing
Result: { "Id": "variableset-Projects-922", "Variables": [] }
Despite testing with | ConvertToJson -Depth 20
the results for the Variables is always coming back as an empty array, what am I missing here?
I am also writing this script inside of a Groovy script in the Jenkins pipeline.