Aida Config
A config file is required to run Aida. You can either run aida init
and follow the initialization steps, or create a .aidarc file in the directory where you want to run Aida.
A sample config structure is as follows:
{
"modelsDir": "../path/to/models",
"outputDir": "./default/output/dir",
"injectors": [
{
"name": "routes",
"outputType": "none"
},
{
"name": "faked-model",
"outputType": "file",
"outputFilepath": "./any/path/filename.json",
"options": {
"itemsPerModel": 10,
"modelType": "core"
}
},
{
"name": "swagger",
"outputType": "file",
"outputFilepath": ""
}
]
}
Note that all injectors accept a single options
object in the .aidarc config file. The options object can contain either own properties, or properties defined in the options of its dependencies in order to override them.
General Options
Option Name | Description | Default Value |
---|---|---|
modelDir | Path to the folder where your models are located | Required |
outputDir | The default output directory if injectors haven't specified an output filepath | Required |
injectors | An array of injectors you wish to run. Each injector object has a set of options | Required |
Injector Options
Option Name | Description | Default Value |
---|---|---|
name | The name of the injector. It is the name of the package (for example, "@aida/injector-faked-model"), without the "@aida/injector-" part. | Required |
outputType | Specifies the type of output for the injector. Enum("none", "file") |
"none"
|
outputFilepath | If the outputType is "file", it specifies the path and filename to write the injector result to. |
outputDir/injectorName
|
options | Injector-specific runtime options. Check the documentation of each injector for more details. | Injector-specific |