-
-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force root wrapping per class #33
Comments
Yes, that sounds reasonable the way you suggest. |
Added as suggested; need to add support in |
Hmmh. Actually, may need to re-think this one... unfortunately there is bit of a speed bump that I ignored earlier. Problem being that to find the flag, a lookup is needed. I need to think about this a bit more. |
Ok, I will have to revert this, since I don't think I can figure it out before 2.4.0 release. Will leave this open so that hopefully it can be included in 2.5. |
Note: was not included in 2.5. |
You might wanna clean up the JavaDoc on Other than that, +1 for adding this :). |
Is there a plan to include this one in near future? We are quite depending on it, so we need to plan at least :) |
@jbm4sa No one working actively on this that I am aware of. Contributions welcome. But I will move this to |
Moved to FasterXML/jackson-databind#1022 |
Is there any way to remove default root wrapping? I want to send json without root element and I am not giving @JsonRootName still its wrapping with class name? Please suggest something. @chrylis @cowtowncoder |
@mv07517 Couple of ways. As to why root wrapping seems to be enabled in your case, I do not know. For questions, please use the mailing list in future; or, if you do have what you think is a bug, file a new issue with reproduction. Tagging questions to existing issues tends to make discussions more convoluted and harder to read. |
Any progress on this? I am looking at |
Seems like this is still commented out. Any thoughts on reintroducing this functionality? Would be great to do on a per-class basis rather than affecting the entire object mapper. |
@cxl-todd Unfortunately support was never implemented, even though annotation declaration was accidentally released. |
I need this functionally to, I need that object mapper only wrap root when class has the annotation. Any advance? |
@malloc32 for help with usage etc, mailing lists would be the place to ask, not issue. I can't think of anything simple that would do this automatically just based on annotation. |
I'm working on mapping an external service that sends postbacks in wrapped JSON. I have set the
@JsonRootName
on the class and can read objects with a specially-configured mapper, but this wrapping behavior belongs to this service (i.e., a certain set of classes) specifically, and not to the overall system (Spring MVC, which expects a single mapping configuration).Since it's known that this class will always need to be unwrapped, and request classes wrapped, it would be much clearer to be able to force root wrapping per class, perhaps with an
alwaysWrap
field on the@JsonRootName
annotation. Is this a feasible feature?The text was updated successfully, but these errors were encountered: