swagger-api / swagger-api/swagger-codegen

Error usin paramater -o in generate for the same folder

Open
#8,025 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

When you call swagger-cogen-cli in Windows, and you add has value for the parameter -o the simbol ".",
it add previously to the root the same, but didnt erase the "."

For example: If you are in the folder C:/swagger and you call like
java -jar swagger-codegen-cli.jar generate -l java -o ./generated/java/ -i ./json/swagger.json ..........
the console will show:
[main] INFO io.swagger.codegen.AbstractGenerator - writing file C:\swagger\.\generated\java

Swagger-codegen version

2.3.1

Swagger declaration file content or url
Command line used for generation

java -jar swagger-codegen-cli.jar generate -l java -o ./generated/java/ -i ./json/swagger.json

Steps to reproduce

Run it

Related issues/PRs
Suggest a fix/enhancement

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 by reproducing the Windows command shown in the issue with the swagger-codegen CLI and compare the output path when -o uses ./generated/java/. Trace how the generate command handles the output-directory argument. Done means the current-folder marker is normalized rather than retained in the generated path; the payload names no source files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.