[BUG] [KOTLIN-MISK] Generated Gradle settings include nonexistent :models project
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
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-misksamples/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
- Check out the latest
master. - Import
samples/server/petstore/kotlin-miskas a Gradle project using Gradle 9.2.0, or open the repository in VS Code with the Microsoft Gradle extension enabled. - Allow Gradle project discovery/configuration to run.
- Open
samples/server/petstore/kotlin-misk/build/reports/problems/problems-report.html. - Observe the warning that project
:modelsis configured without an existing directory. - Repeat with
samples/server/petstore/kotlin-misk-configand 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenAPITools/openapi-generator
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenAPITools/openapi-generator#25014 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenAPITools/openapi-generator#24997 ·
Maintainers usually reply within 1 day
-
Issue: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
OpenAPITools/openapi-generator#24859 ·
Maintainers usually reply within 1 day
-
[BUG][KOTLIN] Fails to compile after updating to 7.25.0 with useJackson3=false useSpringBoot4=trueOpenIssue: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
OpenAPITools/openapi-generator#24842 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
OpenAPITools/openapi-generator#24830 ·
Maintainers usually reply within 1 day
All issues in OpenAPITools/openapi-generator
Similar issues
-
link-check link-check:manual
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
open-telemetry/opentelemetry-java#8870 ·
Maintainers usually reply within 1 day
-
P2 testing
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
enhancement javascript
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area/core kind/bug status/triage team/core-shared
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day