Skip to content

reflection-free serializers ignore @JsonValue declared on a superinterface method #55451

Description

@julianhowarth

Describe the bug

When a class implements a generic interface whose accessor method (let's say value()) carries @JsonValue
but the concrete class itself has no Jackson annotations of its own, the reflection-free Jackson serializer generator does not detect the inherited @JsonValue and instead serializes the object as a plain bean with a value property, i.e. {"value": "ENABLED"} instead of "ENABLED".

We came across this as we use Immutables to generate classes for us, which have the @JsonValue on the superinterface but not the implementation.

Just using Jackson (new ObjectMapper().writeValueAsString(...)) serializes the exact same object correctly,

It happens on quarkus.platform.version 3.37.0 and later, but not on 3.36.3 or earlier. Using quarkus.rest.jackson.optimization.enable-reflection-free-serializers=false allows the code to run correctly on 3.37+

Expected behavior

When calling the resource:

GET /wrapper/plain
200 OK
"ENABLED"

Actual behavior

When calling the resource:

GET /wrapper/plain
200 OK
{"value":"ENABLED"}

i.e. the additional {"value": is unexpected)

How to Reproduce?

reproducer.zip

Output of uname -a or ver

Linux waterhouse 7.1.3-200.fc44.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Jul 4 19:20:12 UTC 2026 x86_64 GNU/Linux

Output of java -version

openjdk version "21.0.8" 2025-07-15 LTS (also Java 25)

Quarkus version or git rev

3.37.2 (also 3.37.0, 3.37.1)

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.8 (36645f6c9b5079805ea5009217e36f2cffd34256)

Additional information

No response

Metadata

Metadata

Assignees

Labels

area/jacksonIssues related to Jackson (JSON library)kind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions