/jackson-datatype-protobuf

Primary LanguageJavaApache License 2.0Apache-2.0

Overview

Jackson module that adds support for serializing and deserializing Google's Protocol Buffers to and from JSON.

Usage

Maven dependency

To use module on Maven-based projects, use following dependency:

<dependency>
  <groupId>com.hubspot.jackson</groupId>
  <artifactId>jackson-datatype-protobuf</artifactId>
  <version>0.9.3</version>
</dependency>

(or whatever version is most up-to-date at the moment)

Registering module

Registration is done as follows:

ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new ProtobufModule());

after which functionality is available for all normal Jackson operations.