Open pombadev opened 2 years ago
Unfortunately, no. The format operator %
/ format function std.format
do not perform full expression interpolation, they only look up the specified key in a flat object. This is the same as the Python 2 string-formatting %
operator (https://docs.python.org/2/library/stdtypes.html#string-formatting-operations).
There was a related feature request from several years ago, #45, asking to add support for ES6 backtick strings (aka template literals).
(I'm aware this question was from a while ago, but perhaps having an answer will be useful for someone in the future)
std.format supports nested objects: https://github.com/google/jsonnet/pull/1011 But syntax is limited to only objects, no array access.
std.format supports nested objects: #1011
Oh, huh... that's interesting. I did not realize that. Thanks for the correction!
Hmm... it looks like that feature was reverted: https://github.com/google/jsonnet/pull/1099
My
jsonnet
file looks like this.I'm trying to access nested field but get an error:
Error:
Expected: