>>102235249
pasting the whole code here just in case
import com.fasterxml.jackson.annotation.JsonUnwrapped;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
class ClassName {
@JsonUnwrapped
AB ab;
int c;
}
@Data
@NoArgsConstructor
class AB {
int a;
int b;
}
void readValue() throws JsonProcessingException {
var json = "{\"a\": 1, \"b\":2, \"c\": 3}";
var mapper = new ObjectMapper();
var o = mapper.readValue(json, ClassName.class);
System.out.println(o);
}