I cannot find the way to declare an array in an array with jsonnet. Here is the syntax I would like to render:
git/push/myrules:
rules:
- changes:
- package.json
- yarn.lock
I do succeed to setup changes as the first element of rules array
local git_push_instance() =
{
['rules']: [
'changes'
]
};
{
['git/push/myrules']: git_push_instance()
}
Here is the output of command line jsonnet rules.jsonnet
{
"git/push/myrules": {
"rules": [
"changes"
]
}
}
But how to setup changes as an array with 2 entries : package.json and yarn.lock ?
I try this but got an error:
local git_push_instance() =
{
['rules']: [
changes: ['package.json', 'yarn.lock']
]
};
{
['git/push/myrules']: git_push_instance()
}
STATIC ERROR: rules.jsonnet:4:16: expected a comma before next array element.