1

I'm trying to change the name of a bean's attribute in a RESTFUL response. I know Payara 5 uses Jsonb as default serialization library but seems that @JsonbProperty annotation is ignored. E.g. If the bean is:

public class MyBean implements java.io.Serializable {
    ....

   @JsonbProperty("myId")
    private Long id;

}

The returned json is { "id": 1234 }, instead of { "myId": 1234 }

Someone has encountered the same problem or I'm missing something?

Thanks in advance

drh
  • 11
  • 1

1 Answers1

0

Adding the lib jakarta.json.bin-api.jar (located at the 'modules' folder) to the war containing the Web Service resolves the problem.

Arghya Sadhu
  • 41,002
  • 9
  • 78
  • 107
drh
  • 11
  • 1