swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
17.09k stars 6.03k forks source link

Exception in thread "main" java.lang.RuntimeException: Can't load config class with name apex #12367

Closed vctqs1 closed 8 months ago

vctqs1 commented 8 months ago
Description

I got error when running codegen for apex

vctqs1@Thus-MBP erp-salesforce % swagger-codegen generate -i http://petstore.swagger.io/v2/swagger.json -o ./packages/lesson/main/default/classes 

Exception in thread "Thread-0" java.lang.NullPointerException: language must be specified
    at java.base/java.util.Objects.requireNonNull(Objects.java:349)
    at org.apache.commons.lang3.Validate.notEmpty(Validate.java:913)
    at io.swagger.codegen.v3.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:509)
    at io.swagger.codegen.v3.cli.cmd.Generate.run(Generate.java:386)
    at java.base/java.lang.Thread.run(Thread.java:829)
vctqs1@Thus-MBP erp-salesforce % swagger-codegen generate -i http://petstore.swagger.io/v2/swagger.json -o ./packages/lesson/main/default/classes -l apex
13:02:12.401 [main] INFO  i.s.c.v.g.t.AbstractTypeScriptClientCodegen - Template folder: null
13:02:12.403 [main] INFO  i.s.c.v.g.t.AbstractTypeScriptClientCodegen - Template engine: io.swagger.codegen.v3.templates.HandlebarTemplateEngine@641856
Exception in thread "main" java.lang.RuntimeException: Can't load config class with name apex Available: dart
aspnetcore
csharp
csharp-dotnet2
go
go-server
dynamic-html
html
html2
java
jaxrs-cxf-client
jaxrs-cxf
inflector
jaxrs-cxf-cdi
jaxrs-spec
jaxrs-jersey
jaxrs-di
jaxrs-resteasy-eap
jaxrs-resteasy
java-vertx
micronaut
spring
nodejs-server
openapi
openapi-yaml
kotlin-client
kotlin-server
php
python
python-flask
r
ruby
scala
scala-akka-http-server
swift3
swift4
swift5
typescript-angular
typescript-axios
typescript-fetch
javascript

    at io.swagger.codegen.v3.CodegenConfigLoader.forName(CodegenConfigLoader.java:31)
    at io.swagger.codegen.v3.cli.SwaggerCodegen.main(SwaggerCodegen.java:96)
Caused by: java.lang.ClassNotFoundException: apex
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:315)
    at io.swagger.codegen.v3.CodegenConfigLoader.forName(CodegenConfigLoader.java:29)
    ... 1 more
Swagger-codegen version
vctqs1@Thus-MBP erp-salesforce % swagger-codegen version
3.0.54
Swagger declaration file content or URL

N/A

Command line used for generation
swagger-codegen generate -i http://petstore.swagger.io/v2/swagger.json -o ./packages/lesson/main/default/classes -l apex
vctqs1 commented 8 months ago

using swagger-codegen@2 work. i'll close this one