# Forestadmin-schema.json Generation

**URL:** <https://community.forestadmin.com/t/forestadmin-schema-json-generation/3214>\
**Category:** Help me!\
**Tags:** howtos, setup\
**Created:** [September 3, 2021, 1:45pm UTC](https://community.forestadmin.com/t/forestadmin-schema-json-generation/3214 "2021-09-03T13:45:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chihabe](https://avatars.discourse-cdn.com/v4/letter/c/7ba0ec/32.png) [@Chihabe](https://community.forestadmin.com/u/Chihabe)\
**Post date:** [September 3, 2021, 1:45pm UTC](https://community.forestadmin.com/t/forestadmin-schema-json-generation/3214/1 "2021-09-03T13:45:41Z")

</div>

## Expected behavior

forestadmin-schema.json to be generated in the correct repository.

## Actual behavior

The file is generated outside of the working directory.

Docker project directory:

 ![Screenshot 2021-09-03 at 14.43.03](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/e/e3db8bd36ada3b63a86afea2c93eb7b8de1c0dea.jpeg)

Docker root directory:

 ![Screenshot 2021-09-03 at 14.22.34](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/f/f4192eae00738c1772ac2aebca9a292cbb9a4852.jpeg)

## Context

We are working with docker + lerna + yarn workspace and we have a problem with the forestadmin-schema.json file being generated/updated outside of the project directory.

The file is not generated in the correct directory, and we didn’t find how to control the path.

We would like to know how we can either control the path where the file is created, or understand how to manually generate it.

## Stack

- forest-express: “9.2.1”,
- forest-express-sequelize: “8.1.0”,
- lumber-cli: “^4.2.0”,
- express: “4.17.1”,
- database\_type": “mysql”,
- engine: “nodejs”,
- engine\_version: “14.17.4”,
- orm\_version: “5.22.4”
- Project Name: location

---

<div class="post-metadata">

**Author:** ![anon39848301](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@anon39848301](https://community.forestadmin.com/u/anon39848301)\
**Post date:** [September 3, 2021, 2:53pm UTC](https://community.forestadmin.com/t/forestadmin-schema-json-generation/3214/2 "2021-09-03T14:53:00Z")

</div>

Hey @Chihabe, and welcome to our community 👋

We currently don’t have documentation on this, but maybe the `schemaDir` option might be useful in your case.  
Where you do your

```javascript
forest.init({
    ...
    schemaDir: './aFolderThatShouldContainsTheForestadminSchema.json',
})

```

Simply point the folder to where the `.forestadmin-schema.json` should be located.

Let me know if that helps

---

<div class="post-metadata">

**Author:** ![Chihabe](https://avatars.discourse-cdn.com/v4/letter/c/7ba0ec/32.png) [@Chihabe](https://community.forestadmin.com/u/Chihabe)\
**Post date:** [September 7, 2021, 12:54pm UTC](https://community.forestadmin.com/t/forestadmin-schema-json-generation/3214/3 "2021-09-07T12:54:24Z")

</div>

Hello, we’re looking for the opposite of this. We want to specify where the schema should be generated and not where it’s located.

Also is there a way to generate the forestadmin-schema.json manually ?

---

<div class="post-metadata">

**Author:** ![anon79585656](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@anon79585656](https://community.forestadmin.com/u/anon79585656)\
**Post date:** [September 8, 2021, 9:31am UTC](https://community.forestadmin.com/t/forestadmin-schema-json-generation/3214/4 "2021-09-08T09:31:47Z")

</div>

Hello @Chihabe,

The `schemaDir` option will be used bot the reading and generating the schema file.  
Once the option is set, restart your ForestAdmin agent and the `.forestadmin-schema.json` file should be regenerated in the given directory.

Regarding the “manual generation” for the schema file, do you mean you want to write it yourself? If yes, that won’t be possible as it will be overwritten when the agent restarts  
If you want to trigger the schema generation, just remove the file, restart your agent (for your development environment) and the file will be generated.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Chihabe](https://avatars.discourse-cdn.com/v4/letter/c/7ba0ec/32.png) [@Chihabe](https://community.forestadmin.com/u/Chihabe)\
**Post date:** [September 9, 2021, 9:52am UTC](https://community.forestadmin.com/t/forestadmin-schema-json-generation/3214/5 "2021-09-09T09:52:48Z")

</div>

`schemaDir` ended up doing the job.  
Thank you for the help
