Comments (1)
@WindKn the issue here is that you use an hyphen (-
) in a key name. The expression pipelineRun.parameters.product-name
is translated to pipelineRun.parameters.product
minus name
. If you rename product-name
to product_name
it will work.
The below test passes.
@Test
public void test() {
Jinjava jinjava = new Jinjava();
Map<String, Object> context = new HashMap<>();
Map<String, Object> pipelineRun = new HashMap<>();
Map<String, Object> parameters = new HashMap<>();
parameters.put("product_name", "aaaa");
pipelineRun.put("parameters", parameters);
context.put("pipelineRun", pipelineRun);
String template = "x-{{pipelineRun.parameters.product_name}}.zip";
String renderedTemplate = jinjava.render(template, context);
assertEquals(renderedTemplate, "x-aaaa.zip");
}
from jinjava.
Related Issues (20)
- Release? HOT 1
- Is there a way to not render a variable that is not defined?
- [range] unable to modify existing variable inside a range loop HOT 1
- Macros should not generate a breakline
- "list" filter is not working as expected for arrays HOT 1
- Java 17.0.6 + jinjava 2.5.0 function: ".replace" HOT 1
- Expected Exception during execution
- How to retrieve the variables in a template HOT 1
- E/AndroidRuntime: FATAL EXCEPTION: main
- Template Render to keep unresolved variables as-is in the output HOT 4
- Update dependencies with vulnerabilities
- Dependency org.yaml:snakeyaml, leading to CVE problem
- for else control structure doesn't seem to be supported HOT 1
- Engine performance HOT 2
- render template that it is contains one '\r\n' string will return more than one
- Can Dict key be an integer? HOT 2
- CVEs in current version: 2.7.0
- time for 2.7.1 / 2.8.0 ?
- Unexpected behavior comparing empty strings to 0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jinjava.