Skip to content

Commit

Permalink
Fix reflection registration issue with Jackson's @JsonSerialize
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand authored and gsmet committed Oct 1, 2020
1 parent c53659d commit 753a6e1
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.quarkus.jackson.deployment;

import static org.jboss.jandex.AnnotationTarget.Kind.CLASS;
import static org.jboss.jandex.AnnotationTarget.Kind.FIELD;
import static org.jboss.jandex.AnnotationTarget.Kind.METHOD;

import java.util.Arrays;
Expand Down Expand Up @@ -124,13 +123,10 @@ CapabilityBuildItem register() {

// handle the various @JsonSerialize cases
for (AnnotationInstance serializeInstance : index.getAnnotations(JSON_SERIALIZE)) {
AnnotationTarget annotationTarget = serializeInstance.target();
if (FIELD.equals(annotationTarget.kind()) || METHOD.equals(annotationTarget.kind())) {
AnnotationValue usingValue = serializeInstance.value("using");
if (usingValue != null) {
// the Deserializers are constructed internally by Jackson using a no-args constructor
reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, usingValue.asClass().name().toString()));
}
AnnotationValue usingValue = serializeInstance.value("using");
if (usingValue != null) {
// the Serializers are constructed internally by Jackson using a no-args constructor
reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, usingValue.asClass().name().toString()));
}
}

Expand Down

0 comments on commit 753a6e1

Please sign in to comment.