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.06k stars 6.03k forks source link

Error : missing swagger input or config! on docker image #12453

Open enimiste opened 3 months ago

enimiste commented 3 months ago

Docker image : latest

Issue : Unable to generate code from OpenAPI v3 documentation file. The command that i used is :

docker run --rm -v .:/app swaggerapi/swagger-codegen-cli generate \
    -i /app/openapi_hermes_v1.10.0.json \
    -l html2 \
    -o /app/output

Error that i got when running the command :

[main] INFO io.swagger.parser.Swagger20Parser - reading from /app/openapi_hermes_v1.10.0.json
[main] INFO io.swagger.parser.Swagger20Parser - reading from /app/openapi_hermes_v1.10.0.json
[main] INFO io.swagger.codegen.ignore.CodegenIgnoreProcessor - No .swagger-codegen-ignore file found.
Exception in thread "main" java.lang.RuntimeException: missing swagger input or config!
    at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:766)
    at io.swagger.codegen.cmd.Generate.run(Generate.java:307)
    at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)

On Stackoverflow forum, i found that the 2.x version supports only the swagger schema.

defurn commented 2 months ago

you can use this one: https://hub.docker.com/r/swaggerapi/swagger-codegen-cli-v3/