swagger-api / swagger-api/swagger-codegen

[codegen, JAVA] Trying to generate mustache template variables but get full codegen output instead

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

Description

I'm following the information here: https://github.com/swagger-api/swagger-codegen/wiki/Mustache-Template-Variables

Attempting to generate either the models or the operations will load the full codegen folder instead of a json file with variables as expected

its as if the -DdebugOperations or -DdebugModels flags are not being recognized

Swagger-codegen version

2.4.0 (master)

Command line used for generation

java -DdebugOperations -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l csharp -o operations.json

Steps to reproduce
  • Check out master (2.4.0)
  • Run mvn clean install -DskipTests
  • run above command to attempt to generate operations variables into a file called operations.json, note that a directory is created with full codegen output instead. The same occurs when trying to generate models

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 the CLI generation path built by modules/swagger-codegen-cli and reproduce the command using -DdebugOperations, then compare it with -DdebugModels. Verify whether these flags are recognized during the Maven-built CLI invocation. Done means the requested debug output is written as a JSON file instead of a full generated code directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
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.