swagger-api / swagger-api/swagger-codegen

How to reuse existing language support?

Open
#7,002 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

General: Question
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I want to add a bunch of "support" files to existing language. What should I do to copy existing generator+template combo to be able to customize it.
(I would like to work on a copy so that future swagger-codegen changes do not break them. I think I need to modify generator as well to add lines declaring new "support" files.)

I've tried to follow this to create custom code gen:
https://github.com/swagger-api/swagger-codegen#making-your-own-codegen-modules

However I'm unable to copy existing codegen&templates (from modules/swagger-codegen/src/main/resources/*), to folder of newly created codegen module, compile it and then make it visible to swagger-codegen.

PS. swagger-codegen help meta do claim that generator will be generated accordingly to specified language, but it show no option/parameter to specify it.

Swagger-codegen version

2.2.3

Suggest a fix/enhancement

Add documentation showing how to create custom codegen module starting from existing generator&template combo.

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 repository's “Making your own codegen modules” guidance and the contents of modules/swagger-codegen/src/main/resources/*. Reproduce the reported custom-module setup and check the help meta behavior described in the issue. Done means documenting how to reuse and customize an existing generator and templates, including how the resulting module is compiled and made visible.

Written by the indexing model from the issue text.

Assessment

Domain
documentation, tooling
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.