swagger-api / swagger-api/swagger-codegen

open api 3 hard coded template directory to handlebars even when using mustache

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

We have been trying to migrate our custom code generation sbt plugin from swagger 2 to open-api 3 and having difficulties.

swagger codegen 3.0.46 and codegen-generators 1.0.42:

    "io.swagger.codegen.v3" % "swagger-codegen" % "3.0.46",
    "io.swagger.codegen.v3" % "swagger-codegen-generators" % "1.0.42",

We are using mustache templates in a resource folder scala2
We are unable to get the generator to look in this folder and also by default it always prefixes it with "handlebars"
It is confusing when we are using mustache and not handlebars to have to put our templates in a folder called handlebars.

We are extending io.swagger.codegen.v3.generators.scala.AbstractScalaCodegen and io.swagger.codegen.v3.generators.DefaultCodegenConfig for two different code generators and both suffer from the same problem generating scala and proto v2 files.

We read through another thread which says this is fixed and but are unable to figure out the right thing to do.

Any advice would be appreciated.

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 tracing template-directory handling from io.swagger.codegen.v3.generators.scala.AbstractScalaCodegen and io.swagger.codegen.v3.generators.DefaultCodegenConfig. Reproduce the issue with the custom Scala and proto v2 generators and their mustache resource folder; done means templates are located without an inappropriate handlebars prefix.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.