CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-io-dropwizard--dropwizard-jackson

Provides comprehensive Jackson JSON processing support for Dropwizard applications with pre-configured ObjectMapper instances and essential modules.

Pending
Overview
Eval results
Files

index.mddocs/

Dropwizard Jackson

Dropwizard Jackson provides comprehensive Jackson JSON processing support for Dropwizard applications. It offers pre-configured ObjectMapper instances with sensible defaults and essential modules for handling Guava collections, Java 8 Optional and time types, parameter name preservation, enum fuzzy matching, and high-performance serialization.

Package Information

  • Package Name: io.dropwizard:dropwizard-jackson
  • Package Type: Maven
  • Language: Java
  • Installation: Add to Maven dependencies:
<dependency>
    <groupId>io.dropwizard</groupId>
    <artifactId>dropwizard-jackson</artifactId>
    <version>4.0.14</version>
</dependency>

Core Imports

import io.dropwizard.jackson.Jackson;
import io.dropwizard.jackson.JsonSnakeCase;
import io.dropwizard.jackson.Discoverable;
import com.fasterxml.jackson.databind.ObjectMapper;

Basic Usage

import io.dropwizard.jackson.Jackson;
import com.fasterxml.jackson.databind.ObjectMapper;

// Create a fully configured ObjectMapper
ObjectMapper mapper = Jackson.newObjectMapper();

// Serialize an object to JSON
String json = mapper.writeValueAsString(myObject);

// Deserialize JSON to object
MyClass obj = mapper.readValue(json, MyClass.class);

// Create a minimal ObjectMapper (less aggressive configuration)
ObjectMapper minimalMapper = Jackson.newMinimalObjectMapper();

Architecture

The package is built around the central Jackson utility class which provides factory methods for creating pre-configured ObjectMapper instances. The configuration includes:

  • Jackson Modules: Guava, JSR-310 time, JDK8 Optional, parameter names
  • Performance Modules: Afterburner or Blackbird for faster serialization
  • Custom Modules: Fuzzy enum handling, Caffeine cache specs, Guava extras
  • Naming Strategy: Snake case support via annotations
  • Subtype Resolution: Service discovery for polymorphic configurations

Capabilities

ObjectMapper Factory

Creates pre-configured Jackson ObjectMapper instances optimized for Dropwizard applications.

public static ObjectMapper newObjectMapper()
public static ObjectMapper newObjectMapper(JsonFactory jsonFactory)
public static ObjectMapper newMinimalObjectMapper()

ObjectMapper Factory

Jackson Modules

Custom Jackson modules for enhanced serialization capabilities including Caffeine cache specs and fuzzy enum handling.

public class CaffeineModule extends Module
public class FuzzyEnumModule extends Module  
public class GuavaExtrasModule extends Module

Jackson Modules

Property Naming Strategy

Annotation-driven property naming that switches between camelCase and snake_case based on class annotations.

public class AnnotationSensitivePropertyNamingStrategy extends PropertyNamingStrategy
public @interface JsonSnakeCase

Property Naming

Subtype Discovery

Service-based discovery mechanism for polymorphic configurations using META-INF/services.

public class DiscoverableSubtypeResolver extends StdSubtypeResolver
public interface Discoverable

Subtype Discovery

Install with Tessl CLI

npx tessl i tessl/maven-io-dropwizard--dropwizard-jackson

docs

index.md

jackson-modules.md

object-mapper-factory.md

property-naming.md

subtype-discovery.md

tile.json