# Gson

Gson is a Java library for converting Java objects to and from JSON.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Gson failure in end-to-end tests

DevFeed: [Gson failure in end-to-end tests](<https://devfeed.tech/articles/gson-failure-in-end-to-end-tests-27330.md>)

Original publisher: [Read original article](<https://blog.pchudzik.com/202201/gson-fail/>)

Published: 2022-01-23T00:00:00Z

Content type: article

Language: en

Sources: [Paweł Chudzik](<https://devfeed.tech/sources/pawe-chudzik.md>)

Topics: [Gson](<https://devfeed.tech/topics/gson.md>), [Java](<https://devfeed.tech/topics/java.md>), [JSON](<https://devfeed.tech/topics/json.md>), [Software Testing](<https://devfeed.tech/topics/software-testing.md>), [Jackson](<https://devfeed.tech/topics/jackson.md>)

Tags: [e2e](<https://devfeed.tech/tags/e2e.md>), [enum](<https://devfeed.tech/tags/enum.md>), [gson](<https://devfeed.tech/tags/gson.md>), [jackson](<https://devfeed.tech/tags/jackson.md>), [java](<https://devfeed.tech/tags/java.md>), [json](<https://devfeed.tech/tags/json.md>), [tests](<https://devfeed.tech/tags/tests.md>), [work](<https://devfeed.tech/tags/work.md>)

### AI overview

This article explains that Gson can silently ignore JSON deserialization problems, such as an unknown enum value, allowing end-to-end tests to pass even when an API contract is broken. It contrasts this behavior with Jackson and describes migrating tests from Gson to Jackson.

### Source excerpt

Using Gson in your e2e tests might result in tests passing even when contract is broken. Gson is quite imprecise when it comes to deserializing objects from json. Is there any difference between an enum and a string? Is there any difference between s string and a number? Using Java you might answer: sure there is. Even when talking about JSON you'll answer: yeah there is a difference. But for GSON? Meh whatever. Read more

## How to use Retrofit on android with Kotlin (KAD 21)

DevFeed: [How to use Retrofit on android with Kotlin (KAD 21)](<https://devfeed.tech/articles/how-to-use-retrofit-on-android-with-kotlin-kad-21-27224.md>)

Original publisher: [Read original article](<https://antonioleiva.com/retrofit-android-kotlin>)

Published: 2017-04-18T00:00:00Z

Content type: tutorial

Language: en

Sources: [Antonio Leiva](<https://devfeed.tech/sources/antonio-leiva.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [API](<https://devfeed.tech/topics/api.md>), [Library](<https://devfeed.tech/topics/library.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [Gson](<https://devfeed.tech/topics/gson.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [build](<https://devfeed.tech/tags/build.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [gson](<https://devfeed.tech/tags/gson.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [okhttp](<https://devfeed.tech/tags/okhttp.md>), [retrofit](<https://devfeed.tech/tags/retrofit.md>)

### AI overview

A Kotlin tutorial showing how to integrate Retrofit 2 into an Android application for making LastFM API requests. It covers Gradle dependencies, OkHttp logging, Gson conversion, request interfaces, service initialization, and making requests with extension functions.

### Source excerpt

Everything Android, Kotlin and other random topics

## Moshi, another JSON Processor

DevFeed: [Moshi, another JSON Processor](<https://devfeed.tech/articles/moshi-another-json-processor-15770.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/moshi-another-json-processor>)

Author: Jesse Wilson

Published: 2017-03-27T19:50:19Z

Content type: article

Language: en

Sources: [Square Corner](<https://devfeed.tech/sources/square-corner-blog-medium.md>)

Topics: [JSON](<https://devfeed.tech/topics/json.md>), [Gson](<https://devfeed.tech/topics/gson.md>)

Tags: [1-4](<https://devfeed.tech/tags/1-4.md>), [adapter](<https://devfeed.tech/tags/adapter.md>), [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [codegen](<https://devfeed.tech/tags/codegen.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [decoder](<https://devfeed.tech/tags/decoder.md>), [decoding](<https://devfeed.tech/tags/decoding.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [encoding](<https://devfeed.tech/tags/encoding.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [google](<https://devfeed.tech/tags/google.md>), [gson](<https://devfeed.tech/tags/gson.md>), [integration-testing](<https://devfeed.tech/tags/integration-testing.md>), [java](<https://devfeed.tech/tags/java.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [json](<https://devfeed.tech/tags/json.md>), [library](<https://devfeed.tech/tags/library.md>), [moshi](<https://devfeed.tech/tags/moshi.md>), [processor](<https://devfeed.tech/tags/processor.md>)

### AI overview

Moshi is presented as a small, efficient JSON library designed to make safer defaults than Gson without changing Gson's established behavior. Gson's default date encoding omits a time zone, and its lenient parsing accepts malformed JSON; changing those behaviors could break applications that rely on them. Moshi instead requires explicit adapters for platform types such as `java.util.UUID`, helping prevent accidental serialization of implementation details, and offers a strict mode that can fail on unexpected fields during integration testing. The excerpt also notes that Moshi 1.4 added JSON values that convert objects to either a byte stream or an in-memory model.

### Source excerpt

It's rare for a programmer to get to work on the same problem twice. Either the first is good enough and you're done, or it wasn't and...

## Getting Started With Retrofit In Android

DevFeed: [Getting Started With Retrofit In Android](<https://devfeed.tech/articles/getting-started-with-retrofit-in-android-22808.md>)

Original publisher: [Read original article](<http://androidessence.com/getting-started-with-retrofit/>)

Author: Adam McNeilly

Published: 2016-10-13T00:00:00Z

Content type: tutorial

Language: en

Sources: [Android Essence](<https://devfeed.tech/sources/android-essence.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Library](<https://devfeed.tech/topics/library.md>), [HTTP](<https://devfeed.tech/topics/http.md>), [Gson](<https://devfeed.tech/topics/gson.md>), [Java](<https://devfeed.tech/topics/java.md>), [JSON](<https://devfeed.tech/topics/json.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [build](<https://devfeed.tech/tags/build.md>), [class](<https://devfeed.tech/tags/class.md>), [code](<https://devfeed.tech/tags/code.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [developer](<https://devfeed.tech/tags/developer.md>), [getting-started](<https://devfeed.tech/tags/getting-started.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [gson](<https://devfeed.tech/tags/gson.md>), [http](<https://devfeed.tech/tags/http.md>), [implement](<https://devfeed.tech/tags/implement.md>), [interface](<https://devfeed.tech/tags/interface.md>), [java](<https://devfeed.tech/tags/java.md>), [json](<https://devfeed.tech/tags/json.md>), [library](<https://devfeed.tech/tags/library.md>), [list](<https://devfeed.tech/tags/list.md>), [model](<https://devfeed.tech/tags/model.md>), [models](<https://devfeed.tech/tags/models.md>), [request](<https://devfeed.tech/tags/request.md>)

### AI overview

A beginner-to-intermediate tutorial explains how to create an Android application using Retrofit as an HTTP client. It covers Gradle dependencies, Gson JSON conversion, model classes, a service interface, API calls, and callbacks for completed requests.

### Source excerpt

As a new or intermediate Android developer, getting started with Retrofit, a popular HTTP client, can seem pretty daunting. However, using this library is not as scary as it sounds. Here are four easy steps to creating your first Retrofit application!

## Retrofit 2.0 Samples

DevFeed: [Retrofit 2.0 Samples](<https://devfeed.tech/articles/retrofit-2-0-samples-31827.md>)

Original publisher: [Read original article](<https://www.metachris.dev/2015/10/retrofit-2-samples/>)

Author: Chris Hager

Published: 2015-10-12T00:00:00Z

Content type: tutorial

Language: en

Sources: [Chris Hager](<https://devfeed.tech/sources/chris-hager.md>)

Topics: [Library](<https://devfeed.tech/topics/library.md>), [API](<https://devfeed.tech/topics/api.md>), [client library](<https://devfeed.tech/topics/client-library.md>), [Java](<https://devfeed.tech/topics/java.md>), [Gson](<https://devfeed.tech/topics/gson.md>), [HTTP](<https://devfeed.tech/topics/http.md>), [Android](<https://devfeed.tech/topics/android.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [JSON](<https://devfeed.tech/topics/json.md>), [GitHub](<https://devfeed.tech/topics/github.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [articles](<https://devfeed.tech/tags/articles.md>), [client-library](<https://devfeed.tech/tags/client-library.md>), [github](<https://devfeed.tech/tags/github.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [gson](<https://devfeed.tech/tags/gson.md>), [java](<https://devfeed.tech/tags/java.md>), [json](<https://devfeed.tech/tags/json.md>), [retrofit](<https://devfeed.tech/tags/retrofit.md>)

### AI overview

A tutorial on using Retrofit 2.0 beta to consume HTTP APIs in Java and Android applications. It covers project setup with Gradle, JSON serialization with Gson, API client definitions, and sample GET and POST requests against httpbin.org.

### Source excerpt

This post is about using Retrofit 2.0 (beta) to consume HTTP based APIs. Retrofit is a great and popular API client library for Java (and by extension also for Android) developed by Square. Here's a few links to start things off: Retrofit Homepage Retrofit Source on Github Retrofit Javadoc Blog post about Retrofit 2.0 Source code with samples for this post is available on Github. Retrofit makes it easy to develop API clients by describing API endpoints and the results like this: