By the way, if you are implementing polymorphic configuration with
Discoverable, you also need to list your interface that extends
Discoverable in a file:
META-INF/services/io.dropwizard.jackson.Discoverable
And then list the implementations if your interface in a similar file
named after the interface. e.g., if your interface is
com.foo.MyFactory , then: META-INF/services/com.foo.MyFactory with
contents such as:
com.foo.MyFactoryImpl1
com.foo.MyFactoryImpl2
Oh, *and* you need an annotation on your interface that extends
Discoverable: @JsonTypeInfo(use =
JsonTypeInfo.Id.NAME, property =
"type")
*And* you need to annotate each implementation of your interface, e.g.
@JsonTypeName("foo1")
With property = "type" in the @JsonTypeInfo annotation on the
interface and @JsonTypeName("foo1") on the implementation of that
interface, your YAML config will need a type property referencing foo1
for Dropwizard/Jackson to do its thing:
foo:
type: foo1
Hope this is useful,
Matt Hurne