swagger-api / swagger-api/swagger-codegen

Swagger-codegen 3.0.54 do not support msf4j server stub

Open
#12,386 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

The documentation shows that swagger-codegen(3.0.54) supports msf4j, but an error is reported during the actual code generation process and it does not support it.
**Documentation link:**https://github.com/swagger-api/swagger-codegen/wiki/Server-stub-generator-HOWTO
image
Actual usage:

10:39:32.583 [main] INFO  i.s.c.v.g.t.AbstractTypeScriptClientCodegen - Template folder: null
10:39:32.584 [main] INFO  i.s.c.v.g.t.AbstractTypeScriptClientCodegen - Template engine: io.swagger.codegen.v3.templates.HandlebarTemplateEngine@3fffff43
Exception in thread "main" java.lang.RuntimeException: Can't load config class with name msf4j 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: msf4j
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:375)
        at io.swagger.codegen.v3.CodegenConfigLoader.forName(CodegenConfigLoader.java:29)
        ... 1 more
Swagger-codegen version

3.0.54

Command line used for generation

"C:\Program Files\Java\jdk-17\bin\java" -jar ./swagger-codegen-cli.jar generate -i ./engr.yaml -l msf4j -o ./server

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with CodegenConfigLoader.forName and SwaggerCodegen.main, then compare the documented msf4j generator with the available configurations shown in the error. Reproduce the supplied 3.0.54 command and verify that msf4j is accepted and generates the requested server stub.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.