GithubHelp home page GithubHelp logo

Comments (16)

 avatar commented on August 24, 2024 1

Is there a plan to include this one in near future? We are quite depending on it, so we need to plan at least :)

from jackson-annotations.

cowtowncoder avatar cowtowncoder commented on August 24, 2024

Yes, that sounds reasonable the way you suggest.

from jackson-annotations.

cowtowncoder avatar cowtowncoder commented on August 24, 2024

Added as suggested; need to add support in jackson-databind next.

from jackson-annotations.

cowtowncoder avatar cowtowncoder commented on August 24, 2024

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.

from jackson-annotations.

cowtowncoder avatar cowtowncoder commented on August 24, 2024

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.

from jackson-annotations.

cowtowncoder avatar cowtowncoder commented on August 24, 2024

Note: was not included in 2.5.

from jackson-annotations.

odrotbohm avatar odrotbohm commented on August 24, 2024

You might wanna clean up the JavaDoc on @JsonRootName accordingly as it still indicate the functionality might be (or better: have been, which it hasn't) introduced in 2.5.

Other than that, +1 for adding this :).

from jackson-annotations.

cowtowncoder avatar cowtowncoder commented on August 24, 2024

@jbm4sa No one working actively on this that I am aware of. Contributions welcome. But I will move this to jackson-databind as it is implement there, even if a tiny part may be relevant here; issues reported here are easier to ignore as well.

from jackson-annotations.

cowtowncoder avatar cowtowncoder commented on August 24, 2024

Moved to FasterXML/jackson-databind#1022

from jackson-annotations.

mdv27 avatar mdv27 commented on August 24, 2024

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

from jackson-annotations.

cowtowncoder avatar cowtowncoder commented on August 24, 2024

@mv07517 Couple of ways. ObjectWriter has withoutRootName() method that can be used to do this for specific calls. Or, you may sub-class JacksonAnnotationIntrospector to sort of hide the annotation.

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.

from jackson-annotations.

OndraZizka avatar OndraZizka commented on August 24, 2024

Any progress on this? I am looking at JacksonAnnotationIntrospector but see no way to do this. findRootName() doesn't affect this behavior.

from jackson-annotations.

cxl-todd avatar cxl-todd commented on August 24, 2024

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.

from jackson-annotations.

cowtowncoder avatar cowtowncoder commented on August 24, 2024

@cxl-todd Unfortunately support was never implemented, even though annotation declaration was accidentally released.
If someone has time to look into this, I could help. But last I checked it seemed difficult to achieve. Esp. compared to relative ease with which one can just wrap root object in a simple Map to achieve the same effect.

from jackson-annotations.

malloc32 avatar malloc32 commented on August 24, 2024

I need this functionally to, I need that object mapper only wrap root when class has the annotation. Any advance?
Thank you.

from jackson-annotations.

cowtowncoder avatar cowtowncoder commented on August 24, 2024

@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.

from jackson-annotations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.