googleapis / googleapis/java-genai
displayName (and other config fields) not included in uploadToFileSearchStore request
- Dominant language
- Java
- Stars
- 397
- Forks
- 125
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 41
Description
#### Environment details
- Programming language: Java
- OS: macOS
- Language runtime version: Java 11+
- Package version: 1.38.0
#### Steps to reproduce
1. Create an `UploadToFileSearchStoreConfig` with `displayName` set:
```java
UploadToFileSearchStoreConfig config = UploadToFileSearchStoreConfig.builder()
.displayName("my-document")
.build();
client.fileSearchStores.uploadToFileSearchStore(storeName, file, config);
```
2. The displayName is silently dropped from the actual API request.
Root Cause
In `FileSearchStores.java`, the `getUploadUrl()` method (line 910-915) creates a new `UploadToFileSearchStoreConfig` with only `httpOptions` and `shouldReturnHttpResponse`, discarding the original `config`'s fields:
```
UploadToFileSearchStoreResumableResponse response =
privateUploadToFileSearchStore(
fileSearchStoreName,
UploadToFileSearchStoreConfig.builder()
.httpOptions(httpOptions)
.shouldReturnHttpResponse(true)
.build());
```
This also affects customMetadata and chunkingConfig.
Expected Behavior
The original config fields (displayName, customMetadata, chunkingConfig) should be preserved and included in the request to the API.
Contributor guide
Assessment
This issue has not been assessed yet.