Skip to content

Instantly share code, notes, and snippets.

@stefanmedack
Created August 23, 2017 15:01
Show Gist options
  • Save stefanmedack/0620fcd069d0f9385e037eb765f3ef81 to your computer and use it in GitHub Desktop.
Save stefanmedack/0620fcd069d0f9385e037eb765f3ef81 to your computer and use it in GitHub Desktop.
val moshi = Moshi.Builder()
.add(DefaultOnDataMismatchAdapter.newFactory(VideoType::class.java, VideoType.unknown)) /* 1 */
.add(DefaultOnDataMismatchAdapter.newFactory(Video::class.java, null)) /* 2 */
.add(DefaultOnDataMismatchAdapter.newFactory(Content::class.java, null)) /* 3 */
.add(FilterNullValuesFromListAdapter.newFactory(Content::class.java)) /* 4 */
.add(DefaultOnDataMismatchAdapter.newFactory(Article::class.java, null)) /* 5 */
.add(KotlinJsonAdapterFactory())
.build()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment