alec
04/24/2020, 5:45 PMalec
04/24/2020, 5:45 PMalec
04/24/2020, 5:45 PMbasher
04/24/2020, 5:46 PMbasher
04/24/2020, 5:46 PMbasher
04/24/2020, 5:46 PMZach Klippenstein (he/him) [MOD]
04/24/2020, 5:47 PMZach Klippenstein (he/him) [MOD]
04/24/2020, 5:47 PMbasher
04/24/2020, 5:48 PMbasher
04/24/2020, 5:49 PMjw
04/24/2020, 6:22 PMjw
04/24/2020, 6:22 PMZach Klippenstein (he/him) [MOD]
04/24/2020, 6:34 PMbasher
04/24/2020, 6:44 PMbasher
04/24/2020, 7:17 PMbasher
04/24/2020, 7:19 PMdave08
04/28/2020, 11:11 AMChintan Soni
04/28/2020, 12:44 PMmyanmarking
04/28/2020, 3:37 PMsaket
04/28/2020, 3:39 PMmyanmarking
04/28/2020, 3:42 PMdanny
04/28/2020, 4:08 PMKris Wong
04/29/2020, 10:27 PMsaket
04/29/2020, 10:36 PMsaket
04/29/2020, 10:37 PMsaket
04/29/2020, 10:38 PMhttps://i.stack.imgur.com/MgNKq.png▾
dave08
04/30/2020, 5:49 AMahmad
05/08/2020, 8:28 PMahmad
05/10/2020, 9:53 PMannotation class MyAnnotation(val value: String)
When I try to create the adapter like this
moshi.adapter<MyAnnotation>(Int::class.java, MyAnnotation::class.java)
It throws
java.lang.IllegalArgumentException: interface com.melegy.moshi.adapters.myannotaion.MyAnnotation must not declare methods.
The exception is thrown from here
https://github.com/square/moshi/blob/master/moshi/src/main/java/com/squareup/moshi/Types.java#L306
When I debug to see what methods does this mean I found that the method is the parameter in the annotation
public abstract java.lang.String com.melegy.moshi.adapters.myannotaion.MyAnnotation.value()
I can create the adapter like this
val adapter = moshi.adapter(MyDataClass::class.java)
But I am asking why the first one can’t work.bodo
05/11/2020, 11:31 AMclass HttpObjec(foo: Foo, date: Date) // date is the current date from the header of the response
interface HttpApi {
@GET(url)
fun doRequest(): HttpObject
}
I don´t want to add a Response object to every function in my interface like
interface HttpApi {
@GET(url)
fun doRequest(): Response<HttpObject>
}
Maybe there are solutions with writing custom adapter or converter, but i did not found a proper one 😞