On Thu, Nov 9, 2017 at 4:17 PM, Kean Erickson <[email protected]> wrote:
> Currently, any @XmlElement JSONObjects in an @XmlRootElement class iare sent
> out as a blank string. Being able to simply use a json object rather than
> package my existing json into a string (handling for curlies rather than a
> blank string as output, yada yada) would clean up my code rather nicely.
>
> Maybe it's naiive to say, but all examples of implementing this marshaling
> myself (based on the two other threads here about this) looks like a bunch
> of unsightly cruft / plumbing that would stick out like a sore thumb in my
> codebase. Is there any way that JSONObjects could be supported as output,
> or would something like that never even be considered for the roadmap?
> Thanks!
If you mean whether you could use module with Java classes like:
public class Stuff {
@JacksonAnnotation // placeholder for any annotation Jackson knows
public JSONObject extra;
}
yes, that is expected usage. Ont thing to note is that `@XmlElement`
is JAXB annotation, and you need another module
(`jackson-module-jaxb-annotations`)
to support that one (if you used `@JsonProperty` instead that would
work without additional modules as it is Jackson native)
If I misunderstood the question, could you add a sample of how you are
trying to use the module?
-+ Tatu +-
--
You received this message because you are subscribed to the Google Groups
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.