All Questions
8,886
questions
-2
votes
0
answers
57
views
json to java pojo deserialization [closed]
I have JSON which I have to convert into a Java POJO. Here is the JSON:
{
"foreclosurePreferences": [
{
"...
-2
votes
0
answers
26
views
How to parse incomplete/partial JSON in Java? [closed]
I’m working on a project where I receive partial JSON data in a stream, and I need to handle the gradual construction of the JSON object as the stream progresses. For instance, the JSON data starts in ...
0
votes
1
answer
23
views
@JsonRootName not working with @RequestBody
enter image description here
I promise input json strings are same,but The Dto's Field around @RequestBody always null;
version
JDK8,17 springboot2.0,3.3 jackson 2.11,2.14
input strings
{ "user&...
-3
votes
1
answer
36
views
The issue is with mapping objects to the model during deserialization [closed]
colleagues! I've encountered an issue with object mapping during deserialization. We have an interface Source, which is implemented by two classes (SimpleSource and ComplexSource). Instances of these ...
-1
votes
0
answers
21
views
Serialize only specified fields/properties at serialization time [duplicate]
I have a POJO with lots of fields, like
public class BigObject {
private final int version;
private final String name;
private final SubObject subObj;
private final Instant time;
// ...
}
...
0
votes
1
answer
45
views
How can I ignore a specific value of a property?
I'm trying to figure out how I can ignore a specific value of a property using Mixin.
For example, there is a class:
class MyClass {
String name;
}
I want to use a MixIn to ignore names with a ...
0
votes
1
answer
58
views
Jackson serialize object property as escaped json string
I am trying to write a custom serializer to take a generic type, serialize it, and then add that json escaped as a string property.
Example
Having
class MyClass(
val value : AType
)
//And AType ...
0
votes
0
answers
53
views
String Deserializes to null instead of Enum in Java Record [duplicate]
I'm trying to deserialize an enum from a json list. Here is my enum
public enum ContactType {
FAX,
EMAIL,
SOCIAL_MEDIA,
WEBSITE,
ADDRESS,
PHONE
}
I have a ContactInfo ...
0
votes
1
answer
30
views
How to deserialize empty and null values of JSON in Jackson using not deprecated methods but overloaded variant that takes context argument?
I know about @JsonDeserialize(using = CustomDeserializer.class) annotation on a field level.
I have this CustomDeserializer:
package com.custom_app.client_app.web.business.dictionary.control....
0
votes
0
answers
29
views
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `javax.activation.DataHandler
`@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class MyDocumentServiceResponse {
@JsonProperty("Status")
protected String status;
@...
0
votes
1
answer
42
views
Can't serialize json with one field as a Map<String, Double>
I have the following kotlin class:
data class MyClass(private val myMap: Map<String, Double>, val defaultValue: Double)
I don't have problems to deserialize it (to convert it from json string ...
0
votes
0
answers
34
views
Jackson: cannot deserialize polymorphic object in submodule
I need to deserialize a json into an object of a child class. The json is deserialized using DebeziumSerdes, which in turn uses jackson at its core. However, I'm met with the exception:
Caused by: com....
1
vote
1
answer
40
views
JSON schema shared fields between multiple objects
I have the following schemas for JSON objects for some endpoints:
{ // Dog.java
"name": "Fido",
"age": 5,
"barkLoudness": 8,
"treatsToday": 2
}...
2
votes
0
answers
41
views
Different handling of null and absent value in json using jackson scala deserialization
I am deserializing json into Scala case classes using jackson and struggle with handling of optional attributes and default values, e.g.
case class MyClass(val1: Option[String] = Some("default&...
1
vote
2
answers
51
views
Jackson Deserialization - Treat specific string values as being null
I am working with an external API and have generated the Java client classes using the OpenAPI generator. One of the fields defined in the response is marked as being of a date type as shown below and ...