Most of API Genie CLI commands use configuration files. This file stores default parameters for API Genie CLI commands specific to your organization.

Structure

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:
      ...
    ...

openapi

This section holds settings which are related to OpenAPI schemas, and do not depend on specific CLI command.

openapi.custom_formats

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.

commands

This section contains settings for CLI commands. Each command has a dedicated entry in this section, those name mimicks the name of the command.

commands.format

Configuration used by the format command. For more details, see format configuration section.

commands.lint

Configuration used by the lint command. For more details, see lint configuration section.

commands.diff

Configuration used by the diff command. For more details, see diff configuration section.

commands.generate

Entries in this section store configuration for specific code generator subcommands.

KeyConfiguration details (link)
commands.generate.datagenerate data configuration
commands.generate.client_fetchgenerate client fetch configuration
commands.generate.server_expressgenerate server express configuration
commands.generate.mock_miragejsgenerate mock miragejs configuration
commands.generate.doc_htmlgenerate doc html configuration