It looks like you are trying to read an object from JSON that actually describes an array. Java objects are mapped to JSON objects with curly braces {} but your JSON actually starts with square brackets [] designating an array.

What you actually have is a List<product> To describe generic types, due to Java's type erasure, you must use a TypeReference. Your deserialization could read: myProduct = objectMapper.readValue(productJson, new TypeReference<List<product>>() {});

A couple of other notes: your classes should always be PascalCased. Your main method can just be public static void main(String[] args) throws Exception which saves you all the useless catch blocks.

Answer from Steven Schlansker on Stack Overflow
🌐
Medium
medium.com › @bubu.tripathy › json-serialization-and-deserialization-in-java-2a3f08266b70
JSON Serialization and Deserialization in Java | by Bubu Tripathy | Medium
April 9, 2023 - The FasterXML Jackson library is a popular Java library used for working with JSON data. It provides a number of annotations that can be used to customize the serialization and deserialization of JSON data.
Discussions

Deserializing Json Object in java
How to convert Java object to / from JSON (Jackson) https://dzone.com/articles/deserializing-json-java-object More on stackoverflow.com
🌐 stackoverflow.com
Deserialization of JSON from an API
However, I cannot figure out a consistent way to deserialize it (using jackson databind) as the players are each an object/attribute of the main object instead of being items in an array. In the past I have made "template" classes of other APIs like this one. package org.example.Data; public class Adp { public Player player; public double value; public int overallRank; public int positionRank; } package org.example.Data; import java... More on reddit.com
🌐 r/learnjava
9
4
June 24, 2024
How can I deserialize json to interface
Stackoverflow.com is probably the best way to discuss issues about why your code is not working as you expect. The issue you are hitting here is likely down to the fact that your interface does not expose a way to set the name. Please understand that deserialization requires Jackson to use Java ... More on github.com
🌐 github.com
2
1
Deserialize issue with JSON property
Hi All, I am reading Couchbase document using below code, QueryResult result = cluster.query(cbStatement); List cbDock = result.rowsAs(CBDocument.class); Json String : { "KEY": "", "METADATA": { }, "PAYLOAD": { } } public class CBDocument implements Serializable { private String id; ... More on couchbase.com
🌐 couchbase.com
11
0
March 11, 2022
🌐
Baeldung
baeldung.com › home › json › jackson › getting started with custom deserialization in jackson
Getting Started with Deserialization in Jackson | Baeldung
September 3, 2024 - Use Jackson to map custom JSON to any java entity graph with full control over the deserialization process.
🌐
GeeksforGeeks
geeksforgeeks.org › java › deserialize-json-array-to-a-single-java-object-with-jackson
Deserialize JSON Array to a Single Java Object with Jackson - GeeksforGeeks
July 23, 2025 - To deserialize an array to an object in Java, we typically use the Jackson library. Jackson unlocks diverse use cases, such as transforming API responses or manipulating structured data within an application.
🌐
Oracle
blogs.oracle.com › javamagazine › java-json-serialization-jackson
Efficient JSON serialization with Jackson and Java | javamagazine
By adding @JsonProperty to your methods, these methods will be used to provide the values for serialization. If the annotation is added to a constructor or method parameter, it marks where the value for deserialization must be applied. These annotations allow you to write simple code that can round-trip between JSON and Java objects, as follows:
🌐
MojoAuth
mojoauth.com › serialize-and-deserialize › serialize-and-deserialize-json-with-java
Serialize and Deserialize JSON with Java | Serialize & Deserialize Data Across Languages
December 14, 2025 - Jackson stands out as a premier, high-performance Java library for handling JSON. Its core strength lies in its ability to seamlessly serialize Java objects into JSON strings and deserialize JSON back into Java objects.
Find elsewhere
🌐
CodeMiner42
blog.codeminer42.com › home › posts › serialization and deserialization in java using jackson
Serialization and Deserialization in Java using Jackson - The Miners
May 29, 2023 - The @JsonProperty annotation is used for mapping an attribute with a JSON key name in both serialization and deserialization. By default when we serialize an object, Jackson will map JSON keys matching the name of the object’s attributes. To change this behavior we use @JsonProperty on the fields.
🌐
GitHub
github.com › FasterXML › jackson-databind › wiki › Deserialization-Features
Deserialization Features
Determines whether JSON null is acceptable for Java primitive types (int, boolean, double etc); if set to 'false', default value is used; if 'true', a JsonProcessingException will be thrown. ... Determines whether JSON integer numbers (0, 1, 2, ...) can be deserialized into Java Enum types; if set to 'false', this is legal and value is used to deserialize value that matches Enum.ordinal(); if 'true', trying to deserialize JSON number into Enum throws a JsonProcessingException
🌐
Snyk
snyk.io › blog › java-json-deserialization-problems-jackson-objectmapper
Java JSON deserialization problems with the Jackson ObjectMapper | Snyk
December 1, 2021 - Default typing is a mechanism in ... POJO but are unsure what subtype the object or the field is, you can simply deserialize to the superclass....
🌐
Google Groups
groups.google.com › g › google-web-toolkit › c › 8uGgSd7V4ns
Best way to Deserialize JSON String to Java Object
You can find details here: http://code.google.com/p/acris/wiki/GWTJsonizer (Project is based on JSONParser from GWT which internally use eval function) Only with using annotations you can get powerfull piece of functionality in JSON parsing mechanism. For example this project was used for deserialize JSON reponses from Google Youtube API in gwt- youtube-api.googlecode.com project.
🌐
Reddit
reddit.com › r › learnjava › comments › 1dnrqw6 › deserialization_of_json_from_an_api
Deserialization of JSON from an API : r/learnjava
June 24, 2024 - Resources for learning Java · Members Online • · marimbaman_462 · Hello! So I've been working on this project that utilizes the Sleeper API for information about the players, and doing the fetch all players get request. However, I cannot figure out a consistent way to deserialize it (using jackson databind) as the players are each an object/attribute of the main object instead of being items in an array.
🌐
Angie Jones
angiejones.tech › home › deserializing api responses into java records
Deserializing API Responses Into Java Records - Angie Jones
September 22, 2024 - The Jackson binding library assists with deserializing API responses and mapping certain fields (like ones with spaces or a different name) to our Java fields.
🌐
Stack Abuse
stackabuse.com › how-to-convert-json-object-to-java-object-with-jackson
How to Convert JSON Object to Java Object with Jackson
February 27, 2023 - To convert a JSON object into a Java object, you'll use the readValue() method of the ObjectMapper instance, which deserializes it into the provided class reference:
🌐
Couchbase
couchbase.com › java sdk
Deserialize issue with JSON property - Java SDK - Couchbase Forums
March 11, 2022 - Hi All, I am reading Couchbase document using below code, QueryResult result = cluster.query(cbStatement); List cbDock = result.rowsAs(CBDocument.class); Json String : { "KEY": "", "METADATA": { }, "PAYLOAD": { } } public class CBDocument implements Serializable { private String id; @JsonProperty("KEY") @JsonAlias({"KEY"}) private String key; @JsonProperty("METADATA") @JsonAlias({"METADATA"}) private JsonObject metadata; @JsonProperty("PAY...
🌐
Quora
quora.com › Using-Java-how-do-you-deserialize-JSON-that-has-unknown-fields-in-it
Using Java, how do you deserialize JSON that has unknown fields in it? - Quora
Answer (1 of 2): Practically speaking: pick a library implementation for (de)serializing JSON, e.g. GSON, then read its documentation. Don’t write code for it yourself unless truly necessary. But let’s suppose that you’re not allowed a library; if we have to roll our own, we’ll try ...
🌐
Quora
quora.com › What-is-meant-by-deserialize-JSON-data-What-is-the-need-to-do-it
What is meant by 'deserialize JSON data'? What is the need to do it? - Quora
Answer (1 of 2): Serialization and de-serialization are processes required to convert your data models into structured formats which can be transmitted across the network or to communicate with another system in general. Usually you have classes which store the data as bytes in memory. For anoth...