Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[BUG] [KOTLIN-MISK] Generated Gradle settings include nonexistent :models project

Open Beginner friendly
#25,021 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
kotlin
Domain
build-system

Research direction

Start with modules/openapi-generator/src/main/resources/kotlin-misk/settings.gradle.kts.mustache and compare it with the generated settings.gradle.kts files in samples/server/petstore/kotlin-misk and kotlin-misk-config. Regenerate both samples, then import or configure them with Gradle to confirm the nonexistent :models project is no longer referenced. Add the regression assertion or build check described in the issue if the existing tests provide a suitable entry point.

Written by the indexing model from the issue text.

Description

Issue: Bug
Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue? The checked-in Kotlin Misk samples reproduce it without a separate specification.
  • Have you validated the input using an OpenAPI validator? Not applicable; the failure is in the generated Gradle settings.
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
Description

The Kotlin Misk generator emits the following line in settings.gradle.kts:

include(":models")

However, it does not generate a models Gradle subproject. Gradle therefore reports that the build configures a project whose directory does not exist.

With Gradle 9.2.0, importing the checked-in samples produces a Problems Report containing:

Configuring project ':models' without an existing directory is not allowed.
The configured projectDirectory '.../samples/server/petstore/kotlin-misk/models'
does not exist, can't be written to or is not a directory.

The problem affects both checked-in samples:

  • samples/server/petstore/kotlin-misk
  • samples/server/petstore/kotlin-misk-config

It also causes Gradle to create untracked files such as:

samples/server/petstore/kotlin-misk/build/reports/problems/problems-report.html
samples/server/petstore/kotlin-misk-config/build/reports/problems/problems-report.html
openapi-generator version

Current master (7.26.0 at the time of reporting).

The problematic line was introduced with the Kotlin Misk generator in commit d81b5a37d12fad974dad55ea0f8dee8a36cfbf12 / #20885 and remains present in the current template.

OpenAPI declaration file content or url

No separate OpenAPI declaration is required. The checked-in Kotlin Misk samples reproduce the issue.

Generation Details

The source template contains the invalid project inclusion:

modules/openapi-generator/src/main/resources/kotlin-misk/settings.gradle.kts.mustache
include(":models")

The generated sample settings contain the same line:

samples/server/petstore/kotlin-misk/settings.gradle.kts
samples/server/petstore/kotlin-misk-config/settings.gradle.kts

Neither sample contains a models directory, and repository history does not show such a subproject previously existing at either location.

Steps to reproduce
  1. Check out the latest master.
  2. Import samples/server/petstore/kotlin-misk as a Gradle project using Gradle 9.2.0, or open the repository in VS Code with the Microsoft Gradle extension enabled.
  3. Allow Gradle project discovery/configuration to run.
  4. Open samples/server/petstore/kotlin-misk/build/reports/problems/problems-report.html.
  5. Observe the warning that project :models is configured without an existing directory.
  6. Repeat with samples/server/petstore/kotlin-misk-config and observe the same result.
Actual output

Gradle reports:

Configuring project ':models' without an existing directory is not allowed.
Expected output

The generated Kotlin Misk project should contain only valid Gradle project declarations and should configure successfully without referring to a nonexistent subproject.

Related issues/PRs
  • #20885 added the Kotlin Misk generator and the include(":models") declaration.
  • #21165 subsequently updated the Kotlin Misk generator but retained the declaration.
Suggest a fix

Remove the following line from:

modules/openapi-generator/src/main/resources/kotlin-misk/settings.gradle.kts.mustache
include(":models")

Then regenerate both Kotlin Misk samples and add a regression assertion or build check that ensures generated Gradle subprojects refer to existing directories.

Dominant language
Java
Stars
26.8k
Forks
7.7k
Avg merge
2d 18h
Merged PRs (30d)
103

Getting set up

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.

More from OpenAPITools/openapi-generator

All issues in OpenAPITools/openapi-generator

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.