We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Our backend developer returns the following data structure: { code: 0, msg: "success", data: { } } How should this be handled globally?
{ code: 0, msg: "success", data: { } }
The text was updated successfully, but these errors were encountered:
You can just make your data structure depending on your backend structure and wrap the data. It's a serialization problem.
Sorry, something went wrong.
data class BaseResponse<T>( val code: Int, val msg: String, val data: T? )
I am defining the response type in this way
suspend fun getPosts(): ApiResponse<BaseResponse<T>>
I now want to return directly when code == 0
suspend fun getPosts(): ApiResponse<T>>
Any ideas?
No branches or pull requests
Our backend developer returns the following data structure:
{ code: 0, msg: "success", data: { } }
How should this be handled globally?
The text was updated successfully, but these errors were encountered: