Skip to content

Commit

Permalink
Merge pull request #59 from Kent-Kuan/json
Browse files Browse the repository at this point in the history
json: update jackson to 2.16.1
  • Loading branch information
neowu authored Jan 10, 2024
2 parents 6c5552f + d7d0d43 commit 1282670
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ subprojects {

val elasticVersion = "8.11.1"
val kafkaVersion = "3.6.1"
val jacksonVersion = "2.15.3"
val jacksonVersion = "2.16.1"
val junitVersion = "5.10.1"
val mockitoVersion = "5.8.0"
val assertjVersion = "3.25.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.databind.AnnotationIntrospector;
import com.fasterxml.jackson.databind.PropertyName;
import com.fasterxml.jackson.databind.cfg.MapperConfig;
import com.fasterxml.jackson.databind.introspect.Annotated;
import com.fasterxml.jackson.databind.introspect.AnnotatedClass;
import com.fasterxml.jackson.databind.introspect.AnnotatedField;
import core.framework.api.json.Property;

import java.io.Serial;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;

Expand All @@ -29,12 +31,12 @@ public PropertyName findNameForSerialization(Annotated annotated) {
}

@Override
public String[] findEnumValues(Class<?> enumType, Enum<?>[] enumValues, String[] names) {
public String[] findEnumValues(MapperConfig<?> config, AnnotatedClass annotatedClass, Enum<?>[] enumValues, String[] names) {
Map<String, String> mappings = null;
for (Field field : enumType.getDeclaredFields()) {
if (!field.isEnumConstant()) continue;
for (AnnotatedField field : annotatedClass.fields()) {
if (!field.getAnnotated().isEnumConstant()) continue;

Property enumValue = field.getDeclaredAnnotation(Property.class);
Property enumValue = field.getAnnotation(Property.class);
if (enumValue == null) continue;

String value = enumValue.name();
Expand Down

0 comments on commit 1282670

Please sign in to comment.