I am using jsonnet to process a response that is structured like so:
{
"resources": [
{
"response_body": {
"id": "test_id",
"key": "test_key",
"self": "https://someurl.com/test/1234"
}
........
I am attempting to process hte response with the following jsonnet:
local result = std.parseJson(std.extVar('result'));
local resource = result.resources[0];
{
result_fields: {
issue_url: resource.response_body.self,
issue: resource.response_body.id
}
}
But it's throwing the error:
JsonnetTokenType.IDENTIFIER expected, got 'self'
How would I go about access the self
value from my response?