Nested variable rendering when using file-type parameters #1607
Replies: 2 comments 4 replies
-
Hi @reinhard-brandstaedter, I was not able to reproduce your issue, but I made a small change to the loop you're using, adding commas to the JSON array using I am using the following setup: template.yaml
config.yaml
dql.txt
This results in the following SRGs: Could you please provide a reproducible sample of the issue you are facing so that we can investigate further? |
Beta Was this translation helpful? Give feedback.
-
Hi @Laubi , query.dql
template.json
This creates a recursive (?) invalide payload inside the rendered JSON template which fails when posting to the API. Instead of the locale variable the placeholder is replaced with the whole map during the file reference rendering: So what I was wondering is if it would be possible to achieve this by:
|
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm trying to make my config better readable as having DQL queries directly in JSON templates is really badly human readable.
So I have moved from having DQL in json like this (long complex newline/escaped string):
to externalizing it via a single file, referenced in the config.yaml:
This works fine. First I even did with a compound type and have the DQL inline in the config.yaml. I can then reference the DQL in the json template like this, which is much cleaner:
However now comes the tricky part. When I want to use a template iteration in the json template that should replace a placeholder in the DQL file content (which wasn't replaced by the initial parameter rendering, this doesn't work:
This is rendered into an objective for every locale in the list, but the content of the file (which also contains placeholders like "{{ . }}") is not rendered anymore.
I know go template doesn't support nested placeholders, but has anyone found a workaround for this usecase?
Beta Was this translation helpful? Give feedback.
All reactions