Is there a way to force Jackson not to put the class name in the Json output? I asked a question that led to this question, but I'm asking what I hope is a more focused question. I'm using Spring MVC while doing this, but I'm not sure how much that matters.
So, instead of
{"NamedSystem":{"name":"Bob Dole","id":"0198b96c-fe18-4aa6-9e61-b5f7149414c2"}}
I want
{"name":"Bob Dole","id":"0198b96c-fe18-4aa6-9e61-b5f7149414c2"}
I might prefer the former, but I don't know how to get Jackson to recognize the class name when deserializing, so if anyone knows that, that would be helpful too.
I found a way to do this with Spring MVC, thanks to http://pascaldimassimo.com/2010/04/13/how-to-return-a-single-json-list-out-of-mappingjacksonjsonview/#comment-4
I had actually been going down that route (changing the way it's serialized by Spring) and had something similar but not quite the same (and which wasn't working), but this does the trick perfectly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With