# Additional File in resource.json

**URL:** <https://forum.inductiveautomation.com/t/additional-file-in-resource-json/55235>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 21, 2022, 5:13am UTC](https://forum.inductiveautomation.com/t/additional-file-in-resource-json/55235 "2022-01-21T05:13:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [January 21, 2022, 5:13am UTC](https://forum.inductiveautomation.com/t/additional-file-in-resource-json/55235/1 "2022-01-21T05:13:35Z")

</div>

I am working on a project that uses some ignition functionality, and a bunch of normal python functionality.

In doing this we need to write readmes and add some ` __init__.py` files for test automation. However whenever we do this inside the `script-python` file structure, Ignition removes the additional files in the file structure.

We tried adding them into the `resource.json` files like this

```auto
{
  "scope": "A",
  "version": 1,
  "restricted": false,
  "overridable": true,
  "files": [
    "code.py",
    " __init__.py",
    "readme.md"
  ],
  "attributes": {
    "lastModification": {
      "actor": "external",
      "timestamp": "2021-12-14T17:36:00Z"
    },
    "lastModificationSignature": "5b6ab83c0aff225351847f7a2bcd0d7954047035dd425afc76f7459774704a5b"
  }
}

```

But it would still remove them and override the updated `resource.json`

Is there any property we can tweak on the gateway to change this? It would be really nice to be able to store additional files in parallel to scripts and views, so that we can build our documentation into our project. As well as import our scripts for automated testing, which requires the ` __init__.py`.

Appreciate any help!

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [January 21, 2022, 5:28am UTC](https://forum.inductiveautomation.com/t/additional-file-in-resource-json/55235/2 "2022-01-21T05:28:54Z")

</div>

Weird, I just tried this on a different gateway with no issue… Not sure why it worked this time.

It does show these warning in the logs though

```auto
ProjectResourceId{resourcePath=ignition/script-python/MyFolder/MyScriptModule, projectName=MyProjectName} has empty data for key= __init__.py

```

```auto
ProjectResourceId{resourcePath=ignition/script-python/MyFolder/MyScriptModule, projectName=MyProjectName} has empty data for key=readme.md

```

Now I am confused!

It would be nice though if someone at ia (maybe @paul-griffith ?) knows if this is the “_proper_” way to do that?

---

<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:** [January 21, 2022, 12:23pm UTC](https://forum.inductiveautomation.com/t/additional-file-in-resource-json/55235/3 "2022-01-21T12:23:49Z")

</div>

Those warnings imply the `readme.md` and ` __init__.py` files were empty (zero length) when read.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 21, 2022, 5:29pm UTC](https://forum.inductiveautomation.com/t/additional-file-in-resource-json/55235/4 "2022-01-21T17:29:46Z")

</div>

This might work, until it doesn’t. Some of the internal methods we use to update resources will unceremoniously dump ‘additional’ data keys - so even if it works for one resource type (updated by one particular code path) in one version, any of those things being different could change that.

---

<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:** [January 21, 2022, 5:33pm UTC](https://forum.inductiveautomation.com/t/additional-file-in-resource-json/55235/5 "2022-01-21T17:33:26Z")

</div>

Yeah, I didn’t really want to get into that yet, but hitchhiking additional files that a resource doesn’t know about is kind of undefined behavior.

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [January 21, 2022, 6:24pm UTC](https://forum.inductiveautomation.com/t/additional-file-in-resource-json/55235/6 "2022-01-21T18:24:19Z")

</div>

Would it be possible with a feature request to add in a way to support that? Even something as simple as adding an additional key into the attributes object that shows additional files for Ignition to ignore would be simple enough on our end.

Allowing developers to document inside their code with readmes, or add **init**.py for automated testing imports makes projects much easier to understand, test, and develop.

If this doesn’t sound like a crazy ask, I don’t mind creating an ideas post
