Skip to content

Instantly share code, notes, and snippets.

@imrankst1221
Created November 4, 2018 09:16
Show Gist options
  • Save imrankst1221/340337c2fecdb00e42859d5548d79e42 to your computer and use it in GitHub Desktop.
Save imrankst1221/340337c2fecdb00e42859d5548d79e42 to your computer and use it in GitHub Desktop.
Parse JSON to data class using GSON
data class LoginResponse(
@SerializedName("status") val status: Int = 0,
@SerializedName("error") val error: String = "",
@SerializedName("error_type") val errorType: String = "",
@Expose(deserialize = false) // deserialize is this filed is not required
@SerializedName("message") val message: String = ""
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment