bloomreach / bloomreach/discovery-android-sdk
KeywordRedirect fields are always null due to missing @JsonProperty for keys with spaces
- Dominant language
- Kotlin
- Stars
- 1
- Forks
- 1
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
Hi team,
I'm using the Bloomreach Android SDK and encountered an issue when working with KeywordRedirect.
Although the API response includes the keywordRedirect object with valid fields, the deserialized KeywordRedirect instance always has all fields as null.
Example from the JSON response:
"keywordRedirect": {
"redirected url": "/faq",
"redirected query": "faq",
"original query": "faq"
}
However, the SDK's KeywordRedirect model looks like this:
data class KeywordRedirect(
val originalQuery: String? = null,
val redirectedQuery: String? = null,
val redirectedUrl: String? = null
)
Since the JSON uses keys like "redirected url" (with spaces), and the Kotlin model uses camelCase field names, this results in failed deserialization unless @JsonProperty("redirected url") annotations are used.
Expected behavior:
The SDK should correctly map these JSON fields into the KeywordRedirect model. This could be fixed by adding @JsonProperty annotations to the model fields.
Current workaround:
Currently, I have no way to access the raw JSON or override the mapping, which makes it difficult to work with redirects from keyword search responses.
Please consider updating the model or providing a workaround (e.g., access to raw JSON in responses).
Thanks!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the Kotlin KeywordRedirect model and reviewing how its camelCase properties are mapped from the keywordRedirect JSON object. Verify that the fields with spaces deserialize into originalQuery, redirectedQuery, and redirectedUrl, and confirm that valid redirect responses expose those values instead of null.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100