How can I use RetroFit2 responseBodyConverter in Kotlin?

Viewed 1500

I'm trying to use RetroFit's responseBodyConverter() but I'm having some trouble, I'm expected to pass java.lang.annoatation.annoatation as the second parameter, but Kotlin suggests against that and says to use Kotlin.Annotation. I'm unsure of how to do that. Can someone provide an example of responseBodyConverter() in Kotlin?

1 Answers

@bluecup in the AndroidChat slack channel has led me to the correct answer. I ended up doing the following:

Retrofit.responseBodyConverter(<T>, arrayOfNulls<Annotation>(0))

Hope this helps someone else.

Related