Module generate_config

Module generate_config 

Source
Expand description

Configuration for mock generation from OpenAPI specifications

This module provides configuration management for the mockforge generate command, allowing users to customize the mock generation process through configuration files.

§Supported Formats

  • mockforge.toml (recommended, type-safe)
  • mockforge.json (JSON format)
  • mockforge.yaml or mockforge.yml (YAML format)

§Priority Order

  1. CLI arguments (highest precedence)
  2. Configuration file
  3. Environment variables
  4. Default values (lowest precedence)

§Example Configuration

[input]
spec = "openapi.json"

[output]
path = "./generated"
filename = "mock-server.rs"

[plugins]
oas-types = { package = "oas-types" }

[options]
client = "reqwest"
mode = "tags"

Structs§

GenerateConfig
Configuration for mock generation
GenerateOptions
Generation options
InputConfig
Input specification configuration
OutputConfig
Output configuration

Enums§

BarrelType
Barrel file type for organizing exports
PluginConfig
Plugin configuration

Functions§

discover_config_file
Discovery configuration file paths in the current directory
load_generate_config
Load configuration from a file
load_generate_config_with_fallback
Load configuration with fallback to defaults
save_generate_config
Save configuration to a file