OpenAPITools / OpenAPITools/openapi-generator

[BUG][JAVA] Gradle plugin ignores "templateDir"

Open
#5,463 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

The Gradle plugin seems to ignore the templateDir argument set in build.gradle: the argument points to a non-existent directory but no exception is thrown when calling openApiGenerate (whereas a non-existent file as the inputSpec argument does throw).

openapi-generator version

Gradle plugin 4.2.3

OpenAPI declaration file content or url

openapi.yaml

Steps to reproduce
  1. git clone git@github.com:rechvs/openapi-generator-gradle-plugin-debugging.git
  2. ./gradlew openApiGenerate
  3. No exception is thrown, despite templateDir pointing to a non-existent directory.

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 linked build.gradle and openapi.yaml, then run ./gradlew openApiGenerate from the reproduction project. Trace how the Gradle plugin handles the templateDir argument and compare it with inputSpec validation; done means a nonexistent templateDir is reported instead of being silently ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.