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

Bump version of yasson to at least 1.0.11 - to support Java records serialization #4186

Closed
jvissers opened this issue May 9, 2022 · 0 comments
Assignees
Labels
dependencies Pull requests that update a dependency file P3
Milestone

Comments

@jvissers
Copy link

jvissers commented May 9, 2022

Environment Details

  • Helidon Version: 2.5.0
  • Helidon MP
  • JDK version: 17.0.2
  • OS: Ubuntu 22.04 LTS
  • Docker version (if applicable): n/a

Problem Description

Currently Helidon MP 2.5.0 uses Yasson 1.0.8. This version's support for Java record serialization is not optimal. Effectively, when you serialize a record using this arrangement, you'll get an empty JSON payload. The work around for 1.0.8 is to use a naming convention of fields that reflects JavaBean getters, like so:

public record MyRecord(String getName, int getAge){}

As of version 1.0.11 of Yasson, this is no longer required. Also see: eclipse-ee4j/yasson#531. In that version you can simply use:

public record MyRecord(String name, int age){}

Steps to reproduce

Use a simple JAX-RS resource that serializes this record (using stock version of Yasson) in MP 2.5.0.

public record MyRecord(String name, int age){}

You'll get an empty JSON payload

Then change the version of Yasson to 1.0.11 and repeat the above. In this case you'll get a proper JSON object.

@barchetta barchetta added dependencies Pull requests that update a dependency file P3 labels May 12, 2022
@barchetta barchetta added this to the 2.5.1 milestone May 12, 2022
@Verdent Verdent closed this as completed May 26, 2022
@m0mus m0mus added this to Backlog Aug 12, 2024
@m0mus m0mus moved this to Closed in Backlog Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file P3
Projects
Archived in project
Development

No branches or pull requests

3 participants