You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When adding multiple JsonbSerializers of the same class hierarchy, the executed serializer is chosen randomly (can change with each application restart).
Expected behavior
Have a JsonbSerializer hierarchy which prioritizes the most precise matching class. So if we have a FooSerializer for Foo and a BarSerializer for Bar extends Foo, then serializing Bar should always prefer BarSerializer, because it's the most exact match in the class hierarchy.
Environment (please complete the following information):
Output of uname -a or ver: macOS Catalina 10.15.4, Darwin Kernel Version 19.4.0
Output of java -version: 11.0.7
GraalVM version (if different from Java):
Quarkus version or git rev: 1.4.1
Build tool (ie. output of mvnw --version or gradlew --version): Maven 3.6.3
Additional context
I'm not sure if this really belongs to Quarkus, or it's better suited for RestEasy or Yasson Bug Tracker. Already created this issue at EclipseEE JsonB BugTracker: jakartaee/jsonb-api#234
The text was updated successfully, but these errors were encountered:
The spec doesn't say anything about a priority, but it should certainly be deterministic regardless of priorities. I agree with @benneq that the most specific serializer makes sense.
@gsmet go ahead and assign to me and I can investigate further
Describe the bug
When adding multiple JsonbSerializers of the same class hierarchy, the executed serializer is chosen randomly (can change with each application restart).
Expected behavior
Have a JsonbSerializer hierarchy which prioritizes the most precise matching class. So if we have a
FooSerializer
forFoo
and aBarSerializer
forBar extends Foo
, then serializingBar
should always preferBarSerializer
, because it's the most exact match in the class hierarchy.Actual behavior
It's totally random.
To Reproduce
Steps to reproduce the behavior:
Configuration
# empty
Environment (please complete the following information):
uname -a
orver
: macOS Catalina 10.15.4, Darwin Kernel Version 19.4.0java -version
: 11.0.7mvnw --version
orgradlew --version
): Maven 3.6.3Additional context
I'm not sure if this really belongs to Quarkus, or it's better suited for RestEasy or Yasson Bug Tracker. Already created this issue at EclipseEE JsonB BugTracker: jakartaee/jsonb-api#234
The text was updated successfully, but these errors were encountered: