openapi-generator "Can't load config class ... unsupported generator name" in CI
The -g flag selects a generator by name (for example typescript-axios, go, spring). When the name is misspelled or not present in the installed version, OpenAPI Generator fails with "Can't load config class with name ..." and lists what it could not find.
What this error means
openapi-generator-cli fails with "Can't load config class with name <name>. Available options: ..." and exits before generating.
Exception in thread "main" java.lang.RuntimeException:
Can't load config class with name ".//typescript-axious"
Available options:
aspnetcore
...Common causes
The generator name is misspelled
A typo like typescript-axious does not match any registered generator, so the loader cannot find a config class.
The generator is not in the installed version
The name belongs to a newer (or a plugin) generator not bundled in the version of openapi-generator pinned in CI.
How to fix it
List generators and use the exact name
- Run
openapi-generator-cli listto see available names. - Replace
-gwith the exact, correctly spelled generator name. - Re-run generation.
openapi-generator-cli list
openapi-generator-cli generate -i openapi.yaml -g typescript-axios -o ./clientPin a version that includes the generator
If the generator is newer, pin the CLI to a version that ships it so the name resolves.
# openapitools.json
{
"generator-cli": { "version": "7.5.0" }
}How to prevent it
- Use
openapi-generator-cli listto confirm generator names. - Pin the generator CLI version in openapitools.json.
- Keep the generator name in one place (a script) to avoid typos.