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
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.
The text was updated successfully, but these errors were encountered:
Environment Details
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:
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:
Steps to reproduce
Use a simple JAX-RS resource that serializes this record (using stock version of Yasson) in MP 2.5.0.
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.
The text was updated successfully, but these errors were encountered: