public class JacksonConfigurationBundle
extends java.lang.Object
implements io.dropwizard.ConfiguredBundle<io.dropwizard.Configuration>
ObjectMapper
to support HAL structures using Resource
, Link
and EmbeddedResource
and field filtering on client
request for resources annotated by EnableFieldFilter
.
The module registers itself when created in the run method
of the application:
public void run(SolutionServiceConfiguration configuration, Environment environment) {
// ...
JacksonConfigurationBundle.builder(environment).build();
// ...
}
If Jacksons yaml provider is available in the classpath it will be registered as well so that
the application is able to respond to "Accept application/yaml" requests. The JacksonYAMLProvider
is available with com.fasterxml.jackson.jaxrs:jackson-jaxrs-yaml-provider:[jacksonVersion]
. The class will be
loaded dynamically to avoid a forced runtime dependency.
Modifier and Type | Class and Description |
---|---|
static class |
JacksonConfigurationBundle.Builder |
Modifier and Type | Method and Description |
---|---|
static JacksonConfigurationBundle.Builder |
builder() |
void |
initialize(io.dropwizard.setup.Bootstrap<?> bootstrap)
Initializes the
ObjectMapper as in the default Bootstrap but does not add the
FuzzyEnumModule as it breaks enum features of Jackson. |
void |
run(io.dropwizard.Configuration configuration,
io.dropwizard.setup.Environment environment) |
public static JacksonConfigurationBundle.Builder builder()
public void initialize(io.dropwizard.setup.Bootstrap<?> bootstrap)
ObjectMapper
as in the default Bootstrap
but does not add the
FuzzyEnumModule
as it breaks enum features of Jackson.
initialize
in interface io.dropwizard.ConfiguredBundle<io.dropwizard.Configuration>
public void run(io.dropwizard.Configuration configuration, io.dropwizard.setup.Environment environment)
run
in interface io.dropwizard.ConfiguredBundle<io.dropwizard.Configuration>