Skip to content

KeywordRedirect fields are always null due to missing @JsonProperty for keys with spaces #37

@MerkUa

Description

@MerkUa

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions