Replies: 3 comments 1 reply
-
This is not the Retrofit issue tracker. Please ask questions in its discussions section here: https://github.com/square/retrofit/discussions |
Beta Was this translation helpful? Give feedback.
-
This is not a problem with Retrofit. Moshi is failing to create an adapter for the supplied type. However, you haven't provided the full stacktrace of the failure so it's impossible to know what's going on. Going to move to a discussion here. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to use @JSON(name = "Result") property to change the field name and it's not working. The result is always null from retrofit response, but if I use the actual "Result" in the field it is working fine, here's the example data class. What am I missing? There is no crash it just result to null Not Working: Also Not working when using @field:Json(name = "Result") Working: NetworkCall: Dependency: UPDATE: Got it fixed by removing the |
Beta Was this translation helpful? Give feedback.
-
Hi, Can I use MoshiConverterFactory and GsonConverterFactory in single retrofit instance ?
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(
)
@JsonClass(generateAdapter = true)
data class AccessToken(
)
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 ?
I look forward to hearing from you.
Beta Was this translation helpful? Give feedback.
All reactions