jw
02/07/2022, 5:11 PMColton Idle
02/07/2022, 9:19 PMjw
02/07/2022, 9:19 PMColton Idle
02/07/2022, 9:29 PMjw
02/07/2022, 9:30 PMColton Idle
02/07/2022, 9:31 PMColton Idle
02/07/2022, 9:33 PMjw
02/07/2022, 9:37 PMColton Idle
02/07/2022, 9:38 PMyschimke
02/07/2022, 10:15 PMresponse?.networkResponse?.code = 304
should workjw
02/07/2022, 10:22 PMColton Idle
02/09/2022, 2:43 PMColton Idle
02/09/2022, 2:56 PMdata
model is a model that is unique for each network call.
{
"ok": true,
"data": {
...
}
}
Should I try to use generics or a polymorphic type adapter? So something like
suspend fun callOne(): BaseResponse<ActualOneResponse>
suspend fun callTwo(): BaseResponse<ActualTwoResponse>
or should I use PolymorphicJsonAdapterFactory
and ask my backend to send back down a discriminator/labelKey?jw
02/09/2022, 3:02 PM.ok == true
and otherwise propagate the error with an exception (or whatever mechanism you want, like an either type)jw
02/09/2022, 3:02 PMsuspend fun callOne(): ActualOneResponse
Colton Idle
02/09/2022, 4:24 PMaperfilyev
02/09/2022, 5:48 PMjames
02/10/2022, 12:04 AM{
"body": "This is a test",
"body_html": "<div class=\"body\">This is a test</div>"
}
gets deserialized into a model by Moshi with a codegen'd adapter, and at this point what would you expect the string value of model.bodyHtml
to be?:
1. <div class=\"body\">This is a test</div>
2. <div class="body">This is a test</div>
I feel like I'm having a mind blank here. I thought Moshi escaped it for us, but that's not the behavior I'm currently seeing? or am I remembering all wrong?jw
02/10/2022, 12:05 AMjw
02/10/2022, 12:05 AMjw
02/10/2022, 12:05 AMjames
02/10/2022, 12:06 AMjw
02/10/2022, 12:08 AMjames
02/10/2022, 12:09 AMjames
02/10/2022, 12:13 AMfromHtml()
uses some library internally to assist with this, but there's also kotlinx.html
these days which might be useful
any recommendations?james
02/10/2022, 12:29 AM&
, <
, >
and "
🤔jw
02/10/2022, 12:30 AMspierce7
02/14/2022, 4:14 PMalec
02/14/2022, 4:16 PMBruno Kongawi
02/14/2022, 9:44 PM