-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
area/jacksonIssues related to Jackson (JSON library)Issues related to Jackson (JSON library)env/windowsImpacts Windows machinesImpacts Windows machineskind/bugSomething isn't workingSomething isn't working
Milestone
Description
Describe the bug
A reflection-free serializer is generated for classes annotated with @JsonValue but the usage of this annotation is like using a custom serializer so for that classes the reflection-free serialized should be avoided.
Expected behavior
The standard JsonValueSerializer should be used instead of a reflection-free one.
Actual behavior
A reflection-free serializer is created instead of using the standard Jackson serializer.
How to Reproduce?
https://github.com/luca-bassoricci/reflection-free-serializer-issue
Just run tests
Output of uname -a or ver
windows 11
Output of java -version
jdk21
Quarkus version or git rev
3.22.1
Build tool (ie. output of mvnw --version or gradlew --version)
No response
Additional information
To avoid reflection a reflection-free serializer tha calls @JsonValue annotated method should be created:
public class ItemId$quarkusjacksonserializer extends StdSerializer {
public ItemId$quarkusjacksonserializer() {
super(ItemId.class);
}
public void serialize(Object var1, JsonGenerator var2, SerializerProvider var3) throws IOException {
var2.writeXXX(((ItemId) var1).callJsonValueAnnotatedMethod());
}
Metadata
Metadata
Assignees
Labels
area/jacksonIssues related to Jackson (JSON library)Issues related to Jackson (JSON library)env/windowsImpacts Windows machinesImpacts Windows machineskind/bugSomething isn't workingSomething isn't working