Skip to content

Conversation

@lostiniceland
Copy link
Contributor

@lostiniceland lostiniceland commented Jan 9, 2026

resolves #22651

This PR provides a complete implementation of Openapitool for the Mill build tool

Mill is a Scala build tool which can also be used for Java, Kotlin and experimentally for Python, Typescript, Groovy. Its approach is at a sweet spot between Maven (purely declarative) and Gradle (programmable with a lot of plugin magic) since instead of plugins it just relies on tasks and simple libraries. Configuration is done via Scala code or Yaml.

All config-options from the current Maven & Gradle plugins have been evaluated and added in a similar fashion to keep friction as low as possible. Only for git settings and maven coordinates dedicated case-classes have been added since those configurations belong together.

In contrast to the Gradle plugin, this PR keeps everything under Maven control. So no external Mill executable is run as part of the build. The Mill testkit was used instead for testing via ScalaTest (because ScalaTest has integration to TestNG which is used by Openapitools).
Though the module contains a mill-test subproject, this is only meant for manual testing of edge-case configurations and it requires a previous mvn install to run properly.

Technical Committee Scala: @clasnake @shijinkui @Bouillie @ramzimaalej


Summary by cubic

Add first-class Mill support via a new OpenApiModule to generate and validate code from OpenAPI specs, matching Maven/Gradle plugin options. Includes docs, tests, and build wiring for Docker and Maven. Resolves #22651.

  • New Features

    • New Mill module: modules/openapi-generator-mill-plugin with OpenApiModule and OpenApiConfig.
    • Tasks for generate, validate, and clean; config mirrors Maven/Gradle plugins (git and maven coords as case classes).
    • Runs fully under Maven; uses Mill testkit with ScalaTest; no external Mill process in builds.
    • Example mill-test project for manual edge-case testing (requires mvn install).
    • Added module to root pom and included its pom in Docker go-offline for caching.
  • Docs

    • Added Mill section to docs/plugins.md with a minimal setup example.
    • New module README with installation, configuration, and usage examples.

Written for commit 1ca3904. Summary will update on new commits.

Copy link

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

Choose a reason for hiding this comment

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

8 issues found across 18 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="modules/openapi-generator-mill-plugin/src/main/scala/org/openapitools/generator/mill/OpenApiModule.scala">

<violation number="1" location="modules/openapi-generator-mill-plugin/src/main/scala/org/openapitools/generator/mill/OpenApiModule.scala:504">
P1: Logic is inverted: when `skipValidateSpec()` is true, should call `setValidateSpec(false)` to disable validation, not `true`.</violation>

<violation number="2" location="modules/openapi-generator-mill-plugin/src/main/scala/org/openapitools/generator/mill/OpenApiModule.scala:578">
P2: Missing `s` prefix for string interpolation. The literal `$spec` will be logged instead of the actual spec path.</violation>
</file>

<file name="modules/openapi-generator-mill-plugin/README.md">

<violation number="1" location="modules/openapi-generator-mill-plugin/README.md:139">
P2: Type mismatch: return type is `Map[String, String]` but value is `Seq(...)`. Should use `Map(...)` to match the declared return type.</violation>

<violation number="2" location="modules/openapi-generator-mill-plugin/README.md:151">
P2: Type mismatch: return type is `Map[String, String]` but value is `Seq(...)`. Should use `Map(...)` to match the declared return type.</violation>
</file>

<file name="modules/openapi-generator-mill-plugin/mill-test/mill.bat">

<violation number="1" location="modules/openapi-generator-mill-plugin/mill-test/mill.bat:9">
P3: Typo in comment: 'fronmatter' should be 'frontmatter'.</violation>
</file>

<file name="modules/openapi-generator-mill-plugin/mill-test/README.md">

<violation number="1" location="modules/openapi-generator-mill-plugin/mill-test/README.md:3">
P2: Incorrect Markdown syntax for GitHub alert. Use `[!NOTE]` (exclamation inside brackets) instead of `![Note]` to render a proper callout box.</violation>
</file>

<file name="modules/openapi-generator-mill-plugin/mill-test/api/petstore.yaml">

<violation number="1" location="modules/openapi-generator-mill-plugin/mill-test/api/petstore.yaml:342">
P3: Incorrect parameter description: says "ID of pet" but should say "ID of order" since this is the `getOrderById` operation on `/store/order/{orderId}`.</violation>
</file>

<file name="modules/openapi-generator-mill-plugin/mill-test/mill">

<violation number="1" location="modules/openapi-generator-mill-plugin/mill-test/mill:9">
P3: Typo in comment: "fronmatter" should be "frontmatter".</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link

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

Choose a reason for hiding this comment

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

1 issue found across 3 files (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="modules/openapi-generator-mill-plugin/mill-test/README.md">

<violation number="1" location="modules/openapi-generator-mill-plugin/mill-test/README.md:3">
P2: Incorrect GitHub alert syntax. The exclamation mark should be inside the brackets `[!NOTE]` not outside `![NOTE]`. The current syntax `![NOTE]` is image syntax and won't render as an alert box.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

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.

[REQ] Mill Support

1 participant