Dynamic import in Jsonnet

Viewed 305

I want to get input file in Jsonnet so the following is working great for me:

local input          = import './inputfile.json';

Problem is that I want to pass the file name through the Jsonnet CLI and I tried to use --ext-str or TLA but in both cases im getting the following error:

computed imports are not allowed.

I also tried to use --ext-code like here:

jsonnet -J grafonnet-lib --ext-code input=(import "./inputfile.json") createDash.jsonnet

but then I'm getting:

zsh: unknown file attribute: i

Is there any solution for this problem?

0 Answers
Related