Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonbConfig fails to register serializer #504

Closed
sfrank-mc opened this issue Jul 27, 2021 · 2 comments · Fixed by #510
Closed

JsonbConfig fails to register serializer #504

sfrank-mc opened this issue Jul 27, 2021 · 2 comments · Fixed by #510
Assignees
Labels
bug Something isn't working right

Comments

@sfrank-mc
Copy link

Describe the bug
An issue with Yasson percolates to a bug in the Quarkus REST Client (escalated from quarkusio/quarkus#15628):
When a serializer class doesn't explicitly implement JsonbSerializer but rather implicitly does so it will not be registered thus failing to serialize correctly.

Expected behavior
When a serializer is implicitly implementing JsonbSerializer it should be registered to correctly perform serialization.

Actual behavior
Serializer class that is explicitly implementing JsonbSerializer is not registered thus failing to serialize correctly.

To Reproduce

Clone the example repo

Steps to reproduce the behavior:

  1. Have any echo server running at localhost:3000 (e.g. you can use http-echo-server)

  2. Enable JsonConfig.java line 17

  3. Disable JsonConfig.java line 18

  4. Run app (i.e. gradle run or any other way)

  5. Notice the body is [{"key":{"1111":"1","2222":"2"},"value":{"1111":"1","2222":"2"}}]

  6. Disable JsonConfig.java line 17

  7. Enable JsonConfig.java line 18

  8. Run app (i.e. gradle run or any other way)

  9. Notice the body is [{"key":{},"value":{}}]

Environment (please complete the following information):

$ uname -a          
Darwin mc-lon-mb15392 19.6.0 Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64 x86_64
$ java -version
openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)
$ gradle --version
------------------------------------------------------------
Gradle 6.8.3
------------------------------------------------------------

Build time:   2021-02-22 16:13:28 UTC
Revision:     9e26b4a9ebb910eaa1b8da8ff8575e514bc61c78

Kotlin:       1.4.20
Groovy:       2.5.12
Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM:          11.0.7 (AdoptOpenJDK 11.0.7+10)
OS:           Mac OS X 10.15.7 x86_64
@sfrank-mc sfrank-mc added the bug Something isn't working right label Jul 27, 2021
@Verdent Verdent self-assigned this Jul 29, 2021
@Verdent
Copy link
Member

Verdent commented Jul 30, 2021

Hi @sfrank-mc ,
thank you for reporting this issue. It is indeed a bug and it will be fixed in the new version of 2.x and also 1.x

@sfrank-mc
Copy link
Author

Thanks @Verdent !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants