{"record":{"id":"accaf0e2001869c6","repo":"OpenAPITools/openapi-generator","slug":"unsupported-target-s-supplied-s","errorCode":null,"errorMessage":"Unsupported target %s supplied. %s","messagePattern":"Unsupported target (.+?) supplied\\. (.+?)","errorType":"http","errorClass":"ResponseStatusException","httpStatus":404,"severity":"warning","filePath":"modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java","lineNumber":44,"sourceCode":"import org.openapitools.codegen.online.model.GeneratorInput;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.springframework.http.HttpStatus;\nimport org.springframework.web.server.ResponseStatusException;\n\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.util.*;\n\npublic class Generator {\n    private static Logger LOGGER = LoggerFactory.getLogger(Generator.class);\n\n    public static Map<String, CliOption> getOptions(String language) {\n        CodegenConfig config;\n        try {\n            config = CodegenConfigLoader.forName(language);\n        } catch (Exception e) {\n            throw new ResponseStatusException(HttpStatus.NOT_FOUND, String.format(Locale.ROOT, \"Unsupported target %s supplied. %s\",\n                    language, e));\n        }\n        Map<String, CliOption> map = new LinkedHashMap<>();\n        for (CliOption option : config.cliOptions()) {\n            map.put(option.getOpt(), option);\n        }\n        return map;\n    }\n\n    public enum Type {\n        CLIENT(\"client\"), SERVER(\"server\");\n\n        private String name;\n\n        Type(String name) {\n            this.name = name;\n        }\n","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/OpenAPITools/openapi-generator/blob/fcec517be3cf5b7964296bcba25fbc97541484e7/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java#L26-L62","documentation":"Thrown by GET /api/gen/clients/{language}/options and GET /api/gen/servers/{framework}/options (via Generator.getOptions, Generator.java:39-46) when CodegenConfigLoader.forName(language) throws while loading the generator. This is a 404 whose message embeds the loader's exception, so it covers two distinct causes: the name simply is not a registered generator, or a discoverable generator class failed to load (NoClassDefFoundError/missing dependency in a custom deployment). Note it catches Exception, not just RuntimeException, so linkage errors surface here too.","triggerScenarios":"Asking for options of a nonexistent/mistyped generator ('jav', 'python2' on newer versions, renamed/removed generators like 'lumen' or old 'swift'); case mismatch ('Java' vs 'java'); a custom generator registered in META-INF/services but whose classpath is broken; asking /clients/... options for a server-only generator name.","commonSituations":"Hardcoding generator names across openapi-generator versions (generators get renamed/removed between releases); calling the public api.openapi-generator.cloud with a name from an older release; self-hosted images that forgot to bundle custom generator jars.","solutions":["GET /api/gen/clients (and /api/gen/servers) first and use a name exactly as listed, case-sensitive","Match the generator list to your server's openapi-generator version — check the release notes for renamed/removed generators","For custom generators, verify the jar is on the classpath and registered via META-INF/services/org.openapitools.codegen.CodegenConfig","Read the embedded cause after 'Unsupported target ... supplied.' — a loader/linkage error means classpath, not a typo"],"exampleFix":"# before\ncurl -s \"$host/api/gen/clients/jav/options\"   # 404 Unsupported target jav supplied. ...\n\n# after\ncurl -s \"$host/api/gen/clients\" | jq -e 'index(\"java\")' >/dev/null || { echo \"bad generator name\" >&2; exit 1; }\ncurl -s \"$host/api/gen/clients/java/options\"","handlingStrategy":"validation","validationCode":"// fetch the authoritative list and check membership before the options call\nList<String> clients = restTemplate.getForObject(host + \"/api/gen/clients\", List.class);\nif (!clients.contains(language)) {\n    throw new IllegalArgumentException(\"unsupported generator '\" + language + \"'; valid: \" + clients);\n}","typeGuard":"boolean isKnownGenerator(String name, List<String> known) {\n    return name != null && known.stream().anyMatch(name::equals); // case-sensitive\n}","tryCatchPattern":"catch (HttpClientErrorException.NotFound e) {\n    // message embeds the loader cause: typos vs broken custom-generator classpath\n    log.warn(\"options lookup failed: {}\", e.getResponseBodyAsString());\n}","preventionTips":["Cache GET /api/gen/clients + /api/gen/servers per server version and validate names against it","Re-check generator names whenever the self-hosted openapi-generator version changes"],"tags":["http-404","generator-name","classpath","code-gen-config-loader","openapi-generator-online"],"backgroundTag":"unsupported-generator-language","analyzedSha":"fcec517be3cf5b7964296bcba25fbc97541484e7","analyzedAt":"2026-08-22T11:13:11.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}