OpenAPITools / OpenAPITools/openapi-generator

[BUG] Unable to use the project, which is generated by gradle plugin

Open
#17,372 0 comments 0 reactions 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

I am not sure if it's really a bug of documentation for Gradle plugin is missing some information.

Already the sample project has this "issue":
https://openapi-generator.tech/docs/plugins/#gradle

The issue is related to the publishing of the generated kotlin "library" or including it into the existing project set-up.

Sample contains build.gradle located at samples/local-spec

This project contains org.openapi.generator plugin applied. And the output directory points to buildDir/kotlin .

The execution of the ./gradlew openApiGenerate generates complitely new spearate gradle project project at buildDir/kotlin location with own build.gradle.

Then I can manually go to that generated sub-folder and run ./gradlew build there. But it's not clear how to automate it?

E.g. If I run multi-module build from the root project? I can include build.gradle containing org.openapi.generator in the main setting.gradle, but how to include generated project, which does not exist yet ? (before ./gradlew openApiGenerate is completed?)
Another use case would be running "publish" from the root of the project and publish all the artefacts.
For this purpose I should also have the generated project included into the root project somehow.

P.S. Is it possible to "modify" this generated build.gradle somehow ? E.g. Documentation mentions adding compileJava.dependsOn tasks.named("openApiGenerate"). Adding publishing {} information would be another use case.

Am I missing something in the gradle plugin set-up or ?

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 Gradle plugin documentation and the sample at modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle, especially the openApiGenerate task and buildDir/kotlin output. Determine and document the supported workflow for building, including, and publishing the generated project, and whether its generated build.gradle can be customized.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
build-system, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.