Skip to content

migrate from Gson to kotlinx-serialization#26

Merged
romanofranz merged 2 commits into
android:mainfrom
easyhooon:main
Nov 5, 2025
Merged

migrate from Gson to kotlinx-serialization#26
romanofranz merged 2 commits into
android:mainfrom
easyhooon:main

Conversation

@easyhooon

Copy link
Copy Markdown
Contributor

Replace Gson with kotlinx-serialization for JSON serialization across the codebase.
Update README to reflect the change.

Closes #25

Replace Gson with kotlinx-serialization for JSON serialization across the codebase.

Update README to reflect the change.
@google-cla

google-cla Bot commented Nov 4, 2025

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @easyhooon, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request completes a significant technical migration by replacing the Gson library with Kotlinx Serialization throughout the application. This change modernizes the project's approach to JSON handling, aligning it with current Kotlin best practices and leveraging the benefits of a type-safe and performant serialization framework. The update spans build configurations, core data repositories, UI converters, and even test files, ensuring a consistent and complete transition.

Highlights

  • Serialization Library Migration: The project has fully migrated from using Gson to Kotlinx Serialization for all JSON serialization and deserialization tasks.
  • Dependency Updates: The app/build.gradle.kts file has been updated to include the Kotlin serialization plugin and remove the Gson dependency.
  • Codebase Refactoring: All instances of Gson API calls (e.g., toJson, fromJson) have been replaced with their Kotlinx Serialization equivalents (e.g., Json.encodeToString, Json.decodeFromString) across relevant files.
  • Documentation Update: The README.md file has been updated to reflect the change in the serialization library used by the project.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request successfully migrates the project from Gson to kotlinx-serialization for JSON handling. The changes are correct and cover all necessary updates in build files, application code, and tests. I've added a few suggestions to further improve the new serialization logic by centralizing it and making it more robust for future data model changes.

Comment thread app/src/main/java/com/example/cahier/data/OfflineNotesRepository.kt
Comment thread app/src/main/java/com/example/cahier/data/OfflineNotesRepository.kt
Comment thread app/src/main/java/com/example/cahier/ui/Converters.kt Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

@romanofranz romanofranz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks!

@romanofranz romanofranz merged commit bcf8aee into android:main Nov 5, 2025
2 checks passed
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.

Serialization library recommendation

2 participants