Most of API Genie CLI commands use configuration files. This file stores default parameters for API Genie CLI commands specific to your organization.
Configuration can be stored in JSON or YAML files. Below is a sample illustrating its general structure:
version: 1.0
openapi:
custom_formats:
- name: x-id
type: integer
commands:
format:
...
lint:
...
diff:
...
generate:
client_fetch:
...
data:
...
doc_html:
...
mock_miragejs:
...
server_express:
...
...
This section holds settings which are related to OpenAPI schemas, and do not depend on specific CLI command.
This section allows you to define custom OpenAPI formats to handle schemas using non-standard formats, to prevent load errors.
If present, this section must be an array of objects. Each object must contain
the name
and type
properties. name
specifies the format name, and must be
unique within the specification. type
specifies the JSON Schema type to which
the format can be applied.
This section contains settings for CLI commands. Each command has a dedicated entry in this section, those name mimicks the name of the command.
Configuration used by the format
command. For more details, see
format configuration section.
Configuration used by the lint
command. For more details, see
lint configuration
section.
Configuration used by the diff
command. For more details, see
diff configuration section.
Entries in this section store configuration for specific code generator subcommands.
Key | Configuration details (link) |
---|---|
commands.generate.data | generate data configuration |
commands.generate.client_fetch | generate client fetch configuration |
commands.generate.server_express | generate server express configuration |
commands.generate.mock_miragejs | generate mock miragejs configuration |
commands.generate.doc_html | generate doc html configuration |