Comments (16)
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.
Yes, that sounds reasonable the way you suggest.
from jackson-annotations.
Added as suggested; need to add support in jackson-databind
next.
from jackson-annotations.
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.
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.
Note: was not included in 2.5.
from jackson-annotations.
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.
@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.
Moved to FasterXML/jackson-databind#1022
from jackson-annotations.
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.
@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.
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.
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.
@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.
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.
@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)
- remove (alias) "Json" from annotations HOT 1
- FEATURE : add annotation support to generate dependencies / dependentRequired into a schema file HOT 1
- Document that @JsonAlias can be used on enum values HOT 3
- enable @jsonignores ignore property of property of and more... HOT 1
- @JsonIgnore usage instead of @JsonManagedReference and @JsonBackReference HOT 1
- Add @Inherited annotation to all Jackson annotations HOT 2
- `@JsonIgnore` on `public boolean isSomething()` methods: Bug or feature ? HOT 4
- Add support for prefix and suffix on @JsonAnySetter annotation HOT 3
- Allow explicit `JsonSubTypes` repeated names check HOT 1
- A interface has annodationed (@JsonTypeInfo/@JsonSubTypes) , but got a Exception HOT 1
- Multiple Variable Declarations (Single Line) HOT 11
- Add NOTICE file with copyright information HOT 20
- @JsonProperty on a boolean field results into two fields in the final JSON HOT 2
- Add `JsonFormat.Feature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS`
- Add "require type id for subtypes" property for `JsonTypeInfo.Value` in 3.0 HOT 8
- @JsonCreator with constuctor, whitch parameters annotated with @JsonProperty
- Rename ambiguous `JsonProperty.Access.*` constants HOT 1
- Allow `@JsonAnySetter` on `ElementType.PARAMETER` (for use on constructor parameters)
- Convert unit tests to JUnit5 (from JUnit4) HOT 1
- Add `ElementType.PARAMETER` to `@JsonIgnore` to allow use for Constructor parameters HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jackson-annotations.