Generator configuration
The generator has two separate inputs: constructor/CLI execution options and an optional JSON/YAML customization file. The file shapes the API clients an OpenAPI document generates; a Manifest's clients take none of it, and a Manifest run with apiClients set warns that it reads none of them. A customization file cannot override inputPath, outputDir or logger.
Configuration contract
{
"apiClients": {
"Items": { "ignorePathParameters": [] },
"Orders": {
"ignorePathParameters": ["tenantId"],
"methodNames": { "listOrders_1": "listArchivedOrders" }
}
}
}| Setting | Lookup and default | Effect |
|---|---|---|
apiClients | Missing → no per-tag overrides | Keys are exact OpenAPI tag names |
apiClients[tag].ignorePathParameters | Missing → [] | Ordinary API client positional path arguments omitted by exact name |
| Empty array | Explicit override | Keep every ordinary API path argument |
apiClients[tag].methodNames | Missing → names derived from operationIds | Object mapping an operationId to its method name; must be a valid identifier |
methodNames takes precedence over the operation's x-fetcher-method extension and over the name derived from the operationId (see methods). Use it when two operations of one tag derive the same name, which otherwise fails the run with exit code 4.
Ignoring a parameter does not remove its URL template placeholder or supply a value. Supply it through request URL parameters, client defaults, or CoSec attribution.
Resolution and failures
options.configPath (CLI -c) selects the file, which may also be an HTTP/HTTPS URL fetched with the same headers and timeout as the input. Without it the generator reads DEFAULT_CONFIG_PATH, ./wow-generator.config.json. Paths are relative to process.cwd(), not to the input document. JSON/YAML format is inferred from content.
| Situation | Result |
|---|---|
| No file at the default path | Generates with defaults |
| Empty file | Generates with defaults, with a warning |
A file named with configPath/-c does not exist | Fails: GeneratorError configuration, exit code 3 |
| The file cannot be read, is neither JSON nor YAML | Fails, exit code 3 |
A block or option has the wrong shape (apiClients not an object, ignorePathParameters not an array of strings, a methodNames value that is not a valid method name) | Fails, exit code 3 |
An unknown key, such as a misspelt apiClient | Warning naming the key; the key is ignored |
The CLI summary names the configuration it read, and --verbose logs the settings it resolved to (apiClients=Items, Orders). There is no environment-variable merging or automatic multi-file configuration hierarchy.
GeneratorConfiguration and ApiClientConfiguration are exported from the package root as types, so a script can type a configuration it builds; see programmatic API.
Complete application
Save the JSON above as wow-generator.config.json, ensure the spec uses the Items or Orders operation tags, then run:
pnpm exec wow-generator generate -i ./openapi.json -c ./wow-generator.config.json -o ./src/generatedInspect generated method signatures: Items retains tenantId/ownerId; Orders omits tenantId but keeps ownerId. The command does not run generated methods or connect to their API service.
Implementation sources
typescript/wow-generator/src/input/configuration.ts
typescript/wow-generator/src/analysis/apiClients.ts