I have a problem with Retrofit, which uses static type of class, not runtime type to serialize it's RequestBody.
Let's say i have two classes :
class A{
String a;
}
class B extends A{
String b;
}
Now i want to make a request:
@Post("/someUrl)
Observable<Void> someRequest(@Body A body);
I want to pass A or B instances to someRequest, and serialize them properly basing on class type.
I tried to use RuntimeTypeAdapterFactory, it worked well but it gave me additional field after serialization (type field). My A, B classes will be only used for serialization.