Replies: 1 comment
-
I moved back to Moshi discussions. See square/moshi#1721 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working in one project which has morethen 50 APIs and all APIs response structure is same like below :
{
"status": 200,
"message": "Login successfully.",
"result": {
}
}
I create base model class with generic type
@JsonClass(generateAdapter = true)
data class BaseModel(
@JSON(name = "status")
val status: Int,
@JSON(name = "message")
val message: String,
@JSON(name = "result")
val result: Map<String, T>
)
@JsonClass(generateAdapter = true)
data class AccessToken(
@JSON(name = "accessToken")
val accessToken: String
)
It's give error like :
Unable to create converter for com.app.sample.data.model.BaseModel<com.app.sample.data.model.AccessToken> for method AuthService.loginUser in android
How to fixed this issue using MoshiConverterFactory ?
Beta Was this translation helpful? Give feedback.
All reactions