# Modify Jinja transform to handle a number key in JSON

**URL:** <https://community.openhab.org/t/modify-jinja-transform-to-handle-a-number-key-in-json/148484>\
**Category:** Misc\
**Created:** [August 8, 2023, 9:22pm UTC](https://community.openhab.org/t/modify-jinja-transform-to-handle-a-number-key-in-json/148484 "2023-08-08T21:22:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![apella12](https://community.openhab.org/user_avatar/community.openhab.org/apella12/32/117154_2.png) [@apella12](https://community.openhab.org/u/apella12)\
**Post date:** [August 8, 2023, 9:22pm UTC](https://community.openhab.org/t/modify-jinja-transform-to-handle-a-number-key-in-json/148484/1 "2023-08-08T21:22:34Z")

</div>

I’m way beyond my knowledge, but I’m trying to test an [unmerged PR at jinjava](https://github.com/HubSpot/jinjava/pull/934) to handle number keys in a homeassistant JSON to resolve an error that I posted a [github OH-addons issue](https://github.com/openhab/openhab-addons/issues/15145).

I was able to create a jinjava jar locally by copying the proposed PR code. Where I’m stuck is how to get that jar into org.openhab.transform.jinja to satisfy the dependency. The top of the class (JinjaTranformationService) that needs the dependency is

```auto
import com.hubspot.jinjava.Jinjava;
import com.hubspot.jinjava.JinjavaConfig;
import com.hubspot.jinjava.interpret.FatalTemplateErrorsException;

```

What I tried was to make these changes in the POM. I know putting the jar in the {basedir} is a bad idea, but it is just for me at this point and only produces a warning, not an error.

```auto
    <dependency>
      <groupId>com.hubspot.jinjava</groupId>
      <artifactId>jinjava</artifactId>
- <version>2.6.0</version>
- <scope>compile</scope>
+ <version>2.7.1-SNAPSHOT</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/lib/jinjava-2.7.1-SNAPSHOT.jar</systemPath>
    </dependency>

```

The issue appears to be the local file is not satisfying the requirement  
` Unable to resolve org.openhab.transform.jinja/4.1.0.202308081946: missing requirement [org.openhab.transform.jinja/4.1.0.202308081946] osgi.wiring.package; filter:="(osgi.wiring.package=com.hubspot.jinjava)"`

It does seem something is being done with the file because in the maven code I extracted these lines;

`[DEBUG] (s) projectArtifactMap = {com.hubspot.jinjava:jinjava=com.hubspot.jinjava:jinjava:jar:2.7.1-SNAPSHOT:system`  
`[DEBUG] Adding classpath entry: <C:\Users\Robert\GitHub\openhab-addons\bundles\org.openhab.transform.jinja\lib\jinjava-2.7.1-SNAPSHOT.jar>`  
`[DEBUG] AuxClasspath Elements ->[C:\Users\Robert\GitHub\openhab-addons\bundles\org.openhab.transform.jinja\lib\jinjava-2.7.1-SNAPSHOT.jar,`  
`[DEBUG] Adding to AuxClasspath ->C:\Users\Robert\GitHub\openhab-addons\bundles\org.openhab.transform.jinja\lib\jinjava-2.7.1-SNAPSHOT.jar`

and if try the result in OH I get the expected error;

```auto
2023-08-08 16:11:02.320 [ERROR] [Events.Framework] - FrameworkEvent ERROR
org.osgi.framework.BundleException: Could not resolve module: org.openhab.transform.jinja [264]
  Unresolved requirement: Import-Package: com.hubspot.jinjava

```

Two questions; Is this possible? and if yes suggestions?
