Introduction to JSON Schema in Java 1. Overview JSON Schema is a declarative language for validating the format and structure of a JSON Object. It allows us to specify the number of special primitives to describe exactly what a valid JSON Object will look like. The JSON Schema specification is… Continue Reading introduction-to-json-schema-in-java

Deserialize Immutable Objects with Jackson 1. Overview In this quick tutorial, we’ll show two different ways of deserializing immutable Java objects with the Jackson JSON processing library. 2. Why Do We Use Immutable Objects? An immutable object is an object that keeps its state intact since the very moment of… Continue Reading jackson-deserialize-immutable-objects

Inheritance with Jackson 1. Overview In this article, we’ll have a look at working with class hierarchies in Jackson. Two typical use cases are the inclusion of subtype metadata and ignoring properties inherited from superclasses. We’re going to describe those two scenarios and a couple of circumstances where special treatment… Continue Reading jackson-inheritance

Introduction to JSONassert 1. Overview In this article, we’ll have a look at the JSONAssert library – a library focused on understanding JSON data and writing complex JUnit tests using that data. 2. Maven Dependency First, let’s add the Maven dependency: <dependency> <groupId>org.skyscreamer</groupId> <artifactId>jsonassert</artifactId> <version>1.5.0</version> </dependency> Please check out the… Continue Reading jsonassert

Jackson – Bidirectional Relationships 1. Overview In this tutorial, we’ll go over the best ways to deal with bidirectional relationships in Jackson. We’ll discuss the Jackson JSON infinite recursion problem, then – we’ll see how to serialize entities with bidirectional relationships and finally – we will deserialize them. 2. Infinite… Continue Reading jackson-bidirectional-relationships-and-infinite-recursion