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

Diagnose it: did the report reach the service?

Coverage and quality integrations fail in two distinct places: the report was never produced, or it was produced and the upload was rejected. Establish which before touching tokens.

Terminal
# 1. does the report exist and is it non-empty?
ls -la coverage/ && head -5 coverage/lcov.info

# 2. does it reference paths the service can map to the repo?
grep "^SF:" coverage/lcov.info | head -5

# 3. did the upload actually succeed, or just not fail the step?
# most uploaders exit 0 on a rejected upload unless told otherwise

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 openapi-generator "Can't load config class ... unsupported generator name" in CI?
There are 2 common causes: the generator name is misspelled and the generator is not in the installed version. A typo like typescript-axious does not match any registered generator, so the loader cannot find a config class.
How do I fix openapi-generator "Can't load config class ... unsupported generator name" in CI?
There are 2 fixes depending on which cause you have: list generators and use the exact name and pin a version that includes the generator. Work through them in order, since the first is the most common.
What does openapi-generator "Can't load config class ... unsupported generator name" in CI actually mean?
openapi-generator-cli fails with "Can't load config class with name <name>.
How do I stop openapi-generator "Can't load config class ... unsupported generator name" in CI happening again?
Use openapi-generator-cli list to confirm generator names. The prevention section lists 3 changes that keep it from recurring.

Related guides

References

Not every red build is your code. Latchkey repairs the ones that are not, on the runner. Start free → 30-day trial · No credit card