microsoft / microsoft/kiota

[Java] invalid "import" statement for GITHUB.COM api

Open
#7,829 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3.8k
Forks
333
Avg merge
16h 29m
Merged PRs (30d)
116

Description

Found as part of https://github.com/microsoft/kiota/pull/7774:

Using the source code from 2026-06-17 and this command:

```
.\it\generate-code.ps1 -descriptionUrl https://raw.githubusercontent.com/github/rest-api-description/refs/heads/main/descriptions/api.github.com/api.github.com.json -language java -dev
.\it\exec-cmd.ps1 -descriptionUrl https://raw.githubusercontent.com/github/rest-api-description/refs/heads/main/descriptions/api.github.com/api.github.com.json -language java
```

The generated client does not compile:

```
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.15.0:compile (default-compile) on project kiota-gh-api: Compilation failure
[ERROR] /c:/path/to/kiota/it/java/gh/src/main/java/apisdk/repos/item/item/contents/item/WithPathItemRequestBuilder.java:[10,21] cannot find symbol
[ERROR] symbol: class WithPath
[ERROR] location: package apisdk.models
```

The offending line is
```
import apisdk.models.WithPath;
```

After having removed it in the generated client, it seems to compile.

Contributor guide

Open the contributing guide

Research direction

Run the two commands in the issue with the GitHub API description and inspect the generated Java file at it/java/gh/src/main/java/apisdk/repos/item/item/contents/item/WithPathItemRequestBuilder.java. Trace why it emits the unresolved import apisdk.models.WithPath, then verify that the generated client compiles without that invalid import.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
devtools, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.