so check the signature, Item::class is not a Serve...
# arrow
p
so check the signature, Item::class is not a ServerResponse::class
g
Sorry but I m afraid I don’t get it, In Spring reactor, we pass the Class<T> along with mono, so it can unmarshall the response to json.
This particular issue is not there in v0.8.2 of arrow reactor
Please look close at the generics, I did a small emulation of this problem like this, it looks like Kotlin-java interoperability problem, pls let me know if I missing something
Copy code
class SomeClass<out T>(val someOther: SomeOther<out T>) {
}

inline fun <reified T> body(p: () -> SomeClass<T>) {
    SomeJava.fromPublisher(p().someOther, T::class.java)
}
Copy code
public class SomeOther<T> {
}
Copy code
public class SomeJava {
    /*public static <T, P extends SomeOther<T>> void fromPublisher(P publisher, Class<T> elementClass) {
    }*/ // This won't work 🔴

    public static <T> void fromPublisher(@NotNull SomeOther<? extends T> someOther, @NotNull Class<T> java) {
    } // This works ✅
}
IMO