swagger-api / swagger-api/swagger-codegen

Error : missing swagger input or config! on docker image

Open
#12,453 1 comment 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

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.

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

Reproduce the Docker command with the supplied OpenAPI v3 input, then inspect the stack-trace locations in DefaultGenerator.java, Generate.run, and SwaggerCodegen.main. Determine whether the CLI accepts this input and make the behavior or documentation clearly handle the reported case; verify the same command afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, openapi
Domain
backend-api-design, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.