Skip to content

MOBILE-173: Add anntations SerializedName for WebviewBridge#711

Merged
enotniy merged 2 commits into
developfrom
feature/MOBILE-173
May 8, 2026
Merged

MOBILE-173: Add anntations SerializedName for WebviewBridge#711
enotniy merged 2 commits into
developfrom
feature/MOBILE-173

Conversation

@enotniy
Copy link
Copy Markdown
Collaborator

@enotniy enotniy commented May 8, 2026

Copilot AI review requested due to automatic review settings May 8, 2026 10:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens WebView bridge JSON compatibility under obfuscation by adding explicit @SerializedName mappings, and adds unit tests that document/lock in the current behavior of several custom GSON adapters used by the SDK’s operation models.

Changes:

  • Added @SerializedName annotations to WebView bridge messages and payload DTOs to ensure stable JSON keys.
  • Added new unit tests covering read/write/round-trip behavior for multiple GSON TypeAdapters (DateOnly, DateTime, Ids, CustomFields, ProductList response polymorphism, MindboxError).
  • Tightened consumer-rules.pro keep rules (narrower in-app DTO scope; removed overly broad Preference keep rule).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sdk/src/test/java/cloud/mindbox/mobile_sdk/models/operation/adapters/ProductListResponseAdapterTest.kt New tests for array/object/null dispatch behavior of ProductListResponseAdapter.
sdk/src/test/java/cloud/mindbox/mobile_sdk/models/operation/adapters/IdsAdapterTest.kt New tests validating numeric IDs are read as strings and documenting adapter limitations.
sdk/src/test/java/cloud/mindbox/mobile_sdk/models/operation/adapters/DateTimeAdapterTest.kt New tests for ISO8601 parsing and current DateTime write format behavior.
sdk/src/test/java/cloud/mindbox/mobile_sdk/models/operation/adapters/DateOnlyAdapterTest.kt New tests for DateOnly parsing/serialization behavior.
sdk/src/test/java/cloud/mindbox/mobile_sdk/models/operation/adapters/CustomerFieldsAdapterTest.kt New tests for CustomFields map read/write and convertTo behavior.
sdk/src/test/java/cloud/mindbox/mobile_sdk/models/MindboxErrorAdapterTest.kt New tests for MindboxError.toJson() output and documented current read() behavior.
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/WebViewInappViewHolder.kt Added missing @SerializedName annotations for WebView bridge payload fields.
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/WebViewAction.kt Added @SerializedName annotations to bridge message fields for stable JSON keys.
sdk/consumer-rules.pro Adjusted keep rules (removed enum rule, narrowed in-app keep scope to DTO members, removed Preference keep).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@enotniy enotniy force-pushed the feature/MOBILE-173 branch from 35887e7 to d4e5b6c Compare May 8, 2026 11:08
@enotniy enotniy merged commit 19d3886 into develop May 8, 2026
6 checks passed
@enotniy enotniy deleted the feature/MOBILE-173 branch May 8, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants