users@jersey.java.net

[Jersey] Re: Question about using annotations for JSON

From: Pedro Nuno Santos <pedro-nuno-santos_at_telecom.pt>
Date: Tue, 5 Aug 2014 10:02:35 +0100

Like this?

@XmlElement(name = "user-activation-code")


Cheers,
Pedro S.

From: John Brooks [mailto:iresprite_at_gmail.com]
Sent: 04 August 2014 21:29
To: users_at_jersey.java.net
Subject: [Jersey] Question about using annotations for JSON

Hi, all! I've done a little research on how to deal with JSON keys that use hyphens, but most of the answers I see pertain to javascript or some other Java library. When I'm creating a POJO for a JSON payload and I'm processing JSON in my client code using MOX. How do I deal with the hyphens?

I've seen solutions for other libraries that use annotations (like @JsonProperty("user-activation-code")); is there something similar for that in this case?

Thanks in advance!