Skip to content
This repository was archived by the owner on Jun 15, 2026. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.reflect.TypeToken;

import java.io.IOException;
import java.lang.reflect.Field;
Expand Down Expand Up @@ -80,21 +81,27 @@ public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, Bean
public Object deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
JsonNode root = mapper.readTree(jp);
final Class<?> tClass = this.defaultDeserializer.handledType();
for (Field field : tClass.getDeclaredFields()) {
JsonNode node = root;
JsonProperty property = field.getAnnotation(JsonProperty.class);
if (property != null) {
String value = property.value();
if (value.matches(".+[^\\\\]\\..+")) {
String[] values = value.split("((?<!\\\\))\\.");
for (String val : values) {
val = val.replace("\\.", ".");
node = node.get(val);
if (node == null) {
break;
for (Class<?> c : TypeToken.of(tClass).getTypes().classes().rawTypes()) {
// Ignore checks for Object type.
if (c.isAssignableFrom(Object.class)) {
continue;
}
for (Field field : c.getDeclaredFields()) {
JsonNode node = root;
JsonProperty property = field.getAnnotation(JsonProperty.class);
if (property != null) {
String value = property.value();
if (value.matches(".+[^\\\\]\\..+")) {
String[] values = value.split("((?<!\\\\))\\.");
for (String val : values) {
val = val.replace("\\.", ".");
node = node.get(val);
if (node == null) {
break;
}
}
((ObjectNode) root).put(value, node);
}
((ObjectNode) root).put(value, node);
}
}
}
Expand Down