Forestadmin-schema.json Generation

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:

Docker root directory:

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

Hey @Chihabe, and welcome to our community :wave:

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

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

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

Let me know if that helps

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 ?

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.

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

1 Like