Open
Description
I'm testing some Jsonb stuff with Quarkus 1.4.1 and quarkus-resteasy-jsonb, and I came across the following inconsistent behavior:
class Foo { ... }
class Bar extends Foo { ... }
class FooSerializer implements JsonbSerializer<Foo> { ... }
class BarSerializer implements JsonbSerializer<Bar> { ... }
class MyJsonbConfigCustomizer implements JsonbConfigCustomizer {
public void customize(JsonbConfig config) {
config.withSerializers(new FooSerializer(), new BarSerializer());
}
}
@Path("/test")
public class TestResource {
@GET
public Bar test() { ... }
}
Now when I hit my /test Resource, the response isn't consistent between application restarts. Sometimes FooSerializer is called, and sometimes BarSerializer.
I was hoping that there's some kind of "most precise type" hierarchy, that automatically favors BarSerializer.
Is this intended? Or is this an error in Quarkus' / Resteasy's implementation?