Skip to content

0.1-SNAPSHOT

Latest

Choose a tag to compare

@BLDrei BLDrei released this 02 May 23:27
· 5 commits to main since this release

🎉 First Release: Immutable JSON Serialization/Deserialization Library for Java 🎉

I'm excited to announce the first release of a lightweight, principled JSON library for Java that emphasizes immutability, clarity, and strict type handling.

🔧 Key Features:

✅ Deserializes JSON-compliant text into Java objects.

✅ Supports only Java record classes as DTOs — ensuring immutability by design.

✅ The deserialization output is always immutable and consists only of immutable objects/values.

✅ Supported types include: Integer, Long, BigInteger, Double, BigDecimal, Boolean, String, LocalDate, LocalDateTime, enum classes, List, Map, record classes.

✅ Two operational modes for handling Optional fields:

  1. Strict Mode (default): Fields of type Optional are treated as optional; all others are required. If a required field is missing (or explicitly set to null), an exception is thrown.
  2. Lenient Mode: Optional fields are not supported. All fields are treated as optional and may have null values.

✅ Does not assign default values to primitive fields when corresponding data is missing in the JSON input. In fact, doesn't allow primitive values at all.

This release lays the foundation for a reliable and predictable way to map JSON into immutable Java structures — with minimal magic and maximum transparency.

Prerequisites:

  1. Java 21+
  2. import 'com.fasterxml.jackson.core:jackson-databind:2.18.3' in compile and runtime (another version might also work)

Deserialization is split into 2 steps:

  1. JSON -> JsonNode (ATM done with Jackson)
  2. JsonNode -> Java object

Serialization is ATM not the focus of this library, so it can be imperfect. For example, during serialization, special symbols are not escaped.