OpenAPITools / OpenAPITools/openapi-generator

Ability to add files to the template without code changes

Open
#5,219 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

I'm using typescript-fetch template to generate TS api client.
In addition to all standard files I want to generate actions and reducers for my redux code.
Correct me if I'm wrong, but the current template does not support any additional files, so I can't simply add a new file e.g. apis.actions.mustache and use it to generate the file in apis folder?

Is that possible to add some sort of references (e.g. partials from mustache) to automatically resolve templates from files?

template/
.. apis.mustache
.. my_custom.mustache

in apis.mustache to add {{> my_custom }} and the file my_custom.mustache will be used to generate this partial with the model which was passed to apis.mustache

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 typescript-fetch template and the mentioned template/apis.mustache and my_custom.mustache files. Trace how template files and Mustache partials are resolved, then determine the scope of supporting additional generated files without code changes. Done means a defined, usable mechanism for including custom files and generating them in the apis folder.

Written by the indexing model from the issue text.

Assessment

Tech stack
redux, typescript
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.