Skip to content

[MAVEN PLUGIN; GRADLE-PLUGIN] - Add KDoc/Javadoc to the Gradle plugin and integrate Dokka so IDEs show helpful tooltips; fix missing parameter wiring; improve merged-spec handling to match the Maven plugin#24067

Open
Picazsoo wants to merge 14 commits into
OpenAPITools:masterfrom
Picazsoo:feature/add-javadoc-and-kdoc-to-gradle-wrapper

Conversation

@Picazsoo

@Picazsoo Picazsoo commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Adds KDoc/Javadoc to the Gradle plugin with Dokka-powered javadocJar for IDE tooltips, fixes missing parameter wiring, and aligns merged-spec handling with the Maven plugin, including accurate up-to-date checks.

  • New Features

    • Integrated org.jetbrains.dokka-javadoc (2.2.0); javadocJar now builds from Dokka output and is published.
    • Added Gradle options: strictSpec, minimalUpdate, generateRecursiveDependentModels (no plugin defaults; config-file values win unless set), plus mergedFileInfoName, mergedFileInfoDescription, mergedFileInfoVersion (with defaults).
    • Expanded KDoc across Gradle properties and tasks; added Javadoc to Maven verbose and cleanupOutput.
  • Bug Fixes

    • Wired enumNameMappings, operationIdNameMappings, and mergedFileName from the openApiGenerate extension to the task.
    • Passed auth and merged-spec info fields into the merged-spec builder; added a conditional input fingerprint to stabilize up-to-date checks when merging is enabled.
    • Ensured generateRecursiveDependentModels is honored via the global setting; added ParameterWiringRegressionTest (with an enum spec) to prevent regressions.

Written for commit c46500e. Summary will update on new commits.

Review in cubic

Picazsoo added 4 commits June 19, 2026 11:20
   - Add Dokka to gradle plugin build to include KDocs in javadoc JAR
   - Fix missing extension→task wiring for enumNameMappings, operationIdNameMappings, and mergedFileName
   - Add missing parameters absent from Gradle but present in Maven: strictSpec, minimalUpdate,generateRecursiveDependentModels, mergedFileInfoName/Description/Version
   - Fix bug: auth was not passed to MergedSpecBuilder in Gradle
   - Add KDocs to all undocumented extension/task properties including defaults, and Javadoc to verbose/cleanupOutput in Maven plugin
@Picazsoo Picazsoo marked this pull request as ready for review June 19, 2026 11:30
@Picazsoo Picazsoo marked this pull request as draft June 19, 2026 11:30

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 10 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@Picazsoo Picazsoo changed the title Feature/add javadoc and kdoc to gradle wrapper [MAVEN PLUGIN; GRADLE-PLUGIN] - Add KDoc/Javadoc to the Gradle plugin and integrate Dokka so IDEs show helpful tooltips; fix missing parameter wiring; improve merged-spec handling to match the Maven plugin Jun 19, 2026
@Picazsoo Picazsoo marked this pull request as ready for review June 20, 2026 09:29

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 11 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@Picazsoo Picazsoo marked this pull request as draft June 20, 2026 10:02
@Picazsoo Picazsoo marked this pull request as ready for review June 22, 2026 13:10

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 11 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt">

<violation number="1" location="modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt:405">
P2: KDoc contradicts property semantics: `logToStderr` is documented as writing to STDOUT, but should be STDERR.</violation>
</file>

<file name="modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt">

<violation number="1" location="modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt:937">
P2: Merged-spec metadata fingerprint uses ambiguous `|` delimiter concatenation that can cause cache key collisions when user-provided values contain `|`.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread modules/openapi-generator-gradle-plugin/build.gradle

/**
* To write all log messages (not just errors) to STDOUT
* To write all log messages (not just errors) to STDOUT. Defaults to `false`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: KDoc contradicts property semantics: logToStderr is documented as writing to STDOUT, but should be STDERR.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt, line 405:

<comment>KDoc contradicts property semantics: `logToStderr` is documented as writing to STDOUT, but should be STDERR.</comment>

<file context>
@@ -360,11 +397,12 @@ open class OpenApiGeneratorGenerateExtension(private val project: Project) {
 
     /**
-     * To write all log messages (not just errors) to STDOUT
+     * To write all log messages (not just errors) to STDOUT. Defaults to `false`.
      */
     val logToStderr = project.objects.property<Boolean>()
</file context>
Suggested change
* To write all log messages (not just errors) to STDOUT. Defaults to `false`.
+ * To write all log messages (not just errors) to STDERR. Defaults to `false`.

get() {
if (!inputSpecRootDirectory.isPresent) return null
if (inputSpecRootDirectorySkipMerge.getOrElse(false)) return null
return "${mergedFileInfoName.orNull}|${mergedFileInfoDescription.orNull}|${mergedFileInfoVersion.orNull}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Merged-spec metadata fingerprint uses ambiguous | delimiter concatenation that can cause cache key collisions when user-provided values contain |.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt, line 937:

<comment>Merged-spec metadata fingerprint uses ambiguous `|` delimiter concatenation that can cause cache key collisions when user-provided values contain `|`.</comment>

<file context>
@@ -852,9 +873,80 @@ abstract class GenerateTask : DefaultTask() {
+        get() {
+            if (!inputSpecRootDirectory.isPresent) return null
+            if (inputSpecRootDirectorySkipMerge.getOrElse(false)) return null
+            return "${mergedFileInfoName.orNull}|${mergedFileInfoDescription.orNull}|${mergedFileInfoVersion.orNull}"
+        }
+
</file context>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant