OpenAPITools / OpenAPITools/openapi-generator

[REQ] Enhance Gradle plugin to support template locations on the classpath

Open
#14,678 3 comments 3 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

Is your feature request related to a problem? Please describe.

I have set of customized templates that I wish to apply across all of my projects (dozens). Currently I need to supply those files as files within a file-system directory (via templateDir) which isn't ideal given I have so many projects.

Describe the solution you'd like

I would like a new parameter added to the Gradle plugin, to specify a classpath location for templates. Using this approach, I can add the templates as a gradle compileOnly dependency.

Describe alternatives you've considered

As a workaround, I can write a gradle task that executes before the GenerateTask which copies the files from the Jar into a file-system directory, which is then configured as the templateDir.

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 locating the Gradle plugin's GenerateTask and the existing templateDir handling. Trace how templates are loaded, then verify that a new classpath location parameter can use templates from a compileOnly dependency and that generation still works with the existing filesystem directory option.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
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.