Dan Lew Codes
  • Github
Subscribe

json

A collection of 2 posts
json

How Trello Android converted from Gson to Moshi

Trello Android recently converted from using Gson [https://github.com/google/gson] to Moshi [https://github.com/square/moshi] for handling JSON. It was a bit tricky so I wanted to document the process. (For context, Trello Android primarily parses JSON. We rarely serialize JSON, and thus most of the
Nov 1, 2021 — 4 min read
kotlin

The dangers of JSON + default values

The following code converts an object to JSON and then back again: val adapter = Moshi.Builder().build().adapter(Foo::class.java) val foo = Foo(bar = null) val json = adapter.toJson(foo) val foo2 = adapter.fromJson(json) check(foo == foo2) I think most of us would expect check() to pass, but
Jun 23, 2021 — 2 min read
Dan Lew Codes © 2025
Powered by Ghost