Skip to content
Latchkey

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.

openapi-generator
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

  1. Run openapi-generator-cli list to see available names.
  2. Replace -g with the exact, correctly spelled generator name.
  3. Re-run generation.
Terminal
openapi-generator-cli list
openapi-generator-cli generate -i openapi.yaml -g typescript-axios -o ./client

Pin 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
# openapitools.json
{
  "generator-cli": { "version": "7.5.0" }
}

How to prevent it

  • Use openapi-generator-cli list to confirm generator names.
  • Pin the generator CLI version in openapitools.json.
  • Keep the generator name in one place (a script) to avoid typos.

Frequently asked questions

What causes ""Can't load config class""?
A typo like typescript-axious does not match any registered generator, so the loader cannot find a config class.
How do I fix "Can't load config class"?
List generators and use the exact name

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card