life is too short for a diary




Mastering JSON in Java using Jackson

Tags: java

Author
Written by: Tushar Sharma
Featured image for Mastering JSON in Java using Jackson

JSON(Javascript Object Notation) is the universal language for data exchange in modern applications, particularly when working with REST APIs. In Java, Jackson library is often used for JSON processing.

Jackson Core Components

Json Parsing fundamentals

Parse JSON String

Building JSON dynamically

Create new JSON object

Java Objects <-> JSON Conversion

Deserialization (JSON -> Object)

Serialization (Object -> JSON)

Common Issues

Date Handling

Don't forget to register JavaTimeModule

Extra Getters

If the getter have no corresponding field, then deserialization would fail

Use Ignore Unknown Properties

Or use Read-Only Properties


comments powered by Disqus