# \[ABANDONED\] Request to the developers to fix the jsonschema library

**URL:** <https://forum.inductiveautomation.com/t/abandoned-request-to-the-developers-to-fix-the-jsonschema-library/93537>\
**Category:** Ignition\
**Created:** [July 22, 2024, 2:37pm UTC](https://forum.inductiveautomation.com/t/abandoned-request-to-the-developers-to-fix-the-jsonschema-library/93537 "2024-07-22T14:37:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielps1818](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@danielps1818](https://forum.inductiveautomation.com/u/danielps1818)\
**Post date:** [July 22, 2024, 2:37pm UTC](https://forum.inductiveautomation.com/t/abandoned-request-to-the-developers-to-fix-the-jsonschema-library/93537/1 "2024-07-22T14:37:55Z")

</div>

Hello!

So I'm not sure if this is where I should post this.

In our team we are currently using one of Ignitions libraries, the **jsonschema** library.

One of the JSON Schema functionalities is making a reference to another schema _(another file or an url)_.

Let me show you the code of the library that make that works:

```python
1 try {
2 URL url = new URL(schemaUrl);
3 parentSchema = factory.getSchema(url);
4 } catch (MalformedURLException var10) {
5 InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(schemaUrl);
6 parentSchema = factory.getSchema(is);
7 }

```

This work with no problem, with the exception of the line 5. For some reason **getResourceAsStream()** doesn't work in Ignition.

My request to the developers is to change that line of code so the InputStream gets selected correctly.

I know that Ignition doesn't give support to Ignition's Java Docs libraries but the library already has modifications. So maybe another one won't cost.

I'll link in the next comment the complete code of the jsonschema library.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 22, 2024, 4:52pm UTC](https://forum.inductiveautomation.com/t/abandoned-request-to-the-developers-to-fix-the-jsonschema-library/93537/3 "2024-07-22T16:52:01Z")

</div>

What scope (gateway, client/designer) is your code trying to use this library from?

I don't think it was our intention to provide this as a general purpose library for module authors. It looks like it's in the common package simply because we use it from multiple scopes.

---

<div class="post-metadata">

**Author:** ![danielps1818](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@danielps1818](https://forum.inductiveautomation.com/u/danielps1818)\
**Post date:** [July 23, 2024, 8:24am UTC](https://forum.inductiveautomation.com/t/abandoned-request-to-the-developers-to-fix-the-jsonschema-library/93537/4 "2024-07-23T08:24:27Z")

</div>

It's a script in the scripting, so I think it gets executed in the gateway, it is not for a module design. We use it to validate the messages from the http requests (they are in json format).

The library is `com.inductiveautomation.ignition.common.jsonschema`.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 23, 2024, 11:25am UTC](https://forum.inductiveautomation.com/t/abandoned-request-to-the-developers-to-fix-the-jsonschema-library/93537/5 "2024-07-23T11:25:12Z")

</div>

Why are you trying to use `getResourceAsStream()` from jython? That is for retrieving resource files from java jars, not for general file access.

---

<div class="post-metadata">

**Author:** ![danielps1818](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@danielps1818](https://forum.inductiveautomation.com/u/danielps1818)\
**Post date:** [July 23, 2024, 12:04pm UTC](https://forum.inductiveautomation.com/t/abandoned-request-to-the-developers-to-fix-the-jsonschema-library/93537/6 "2024-07-23T12:04:01Z")

</div>

I'm not. That's the code **from** the library. I asking them to change it.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 23, 2024, 12:11pm UTC](https://forum.inductiveautomation.com/t/abandoned-request-to-the-developers-to-fix-the-jsonschema-library/93537/7 "2024-07-23T12:11:12Z")

</div>

No, it’s working as intended.

---

<div class="post-metadata">

**Author:** ![danielps1818](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@danielps1818](https://forum.inductiveautomation.com/u/danielps1818)\
**Post date:** [July 23, 2024, 1:41pm UTC](https://forum.inductiveautomation.com/t/abandoned-request-to-the-developers-to-fix-the-jsonschema-library/93537/8 "2024-07-23T13:41:19Z")

</div>

It is not. I've been trying to make a reference to another schema file for weeks. I even have some tickets open trying to find the problem _(thanks a lot to Jacob Wever, he has been amazing with his help)_.

I've been able to make it work with a normal java project, but for ignition is not possible.

From my understanding `getResourceAsStream()` does not work on Ignition so is not possible to reference another file.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 23, 2024, 1:51pm UTC](https://forum.inductiveautomation.com/t/abandoned-request-to-the-developers-to-fix-the-jsonschema-library/93537/9 "2024-07-23T13:51:29Z")

</div>

> [@danielps1818](#):
>
> The library is `com.inductiveautomation.ignition.common.jsonschema`.

That is an internal library for Ignition's own use. It is not published for integrators' use--IA publishes supported functionality in `system.*`, so it is not something IA supports using. Jython lets you get at the class because jython lets you get at pretty much anything in java. That doesn't make it a supported use. And you seem to have no clue what `getResourceAsStream()` is even **supposed** to do. (It isn't broken **at all**.)

This class is all about validating the JSON that Ignition **itself** uses against schemas that **ship with Ignition**.

To move forward, consider making your own subclass of `BaseJsonValidator`. Not sure if that will work, but it might.

Side note: Do you not see a problem with publicly displaying the complete decompilation of one of IA's copyrighted classes?

---

<div class="post-metadata">

**Author:** ![danielps1818](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@danielps1818](https://forum.inductiveautomation.com/u/danielps1818)\
**Post date:** [July 24, 2024, 12:38pm UTC](https://forum.inductiveautomation.com/t/abandoned-request-to-the-developers-to-fix-the-jsonschema-library/93537/10 "2024-07-24T12:38:32Z")

</div>

I don't understand why would make accessible libraries that shouldn't be.

Also, I didn't thought posting that would be _that bad_ (already deleted).

However, I already asked this topic to be deleted given the negativity of the responses.

Thanks anyway for the help.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 24, 2024, 12:45pm UTC](https://forum.inductiveautomation.com/t/abandoned-request-to-the-developers-to-fix-the-jsonschema-library/93537/11 "2024-07-24T12:45:04Z")

</div>

> [@danielps1818](#):
>
> why would make accessible libraries that shouldn't be.

They aren't _ **deliberately** _ accessible. They are accessible because that's how jython works.

IA **documents** the functionality they support.

> [@danielps1818](#):
>
> asked this topic to be deleted

I would object to that. This topic is educational for others.

(Deleting the copyrighted code was a good action.)
