-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add support for subset of jackson annotations #32
Comments
I'll have to think about this. One of main goals for jackson-jr is to keep things very compact, and this is why no annotation support was added. At the same time, small high-value additions can be considered. In this case, perhaps the first part would be to figure out an extension point for registering an object that could handle naming. Such an object could handle annotation-based renaming, but also possible alternate external naming strategy. Another thing to consider from extensibility standpoint is the added dependency to jackson annotations. This could be a reason implement this as separate maven (sub-module), within same project. As such it could also be contained in |
Agreed, smaller is better, especially when using on Android. But, there's already a dependency on the jackson-core library due to an Exception reference from your project. The jackson-annotations library is only 33kb. Even adding it to the uber-jar, it's still smaller than the main jackson databinder. |
@bkhall Yes, it is smaller, but unlike core, can not easily be shaded. Not so much wrt size of the result (which is small, agreed), but that it is one additional external dependency. Anyway, adding configuration mechanism as a separate sub-module is probably the way to go, shading it (but not annotations -- they need to be separate public, non-relocated types IMO) seems reasonable to me. |
This seems especially useful to map property names with underscores to camel case |
I think this should be an extension piece of some sort, similar to |
I think this is also a must in cases where object keys have spaces in them. In that case, such objects could not be represented by POJOs without the |
It has been a while but I am now considering doing something to handle this and related issues.
I'll have to see how feasible this is, but if it is and I have time, this would go in version 2.10. |
I assume this didn't make it into 2.10? |
2.10 is not out yet. But it may be that I won't have time to do it properly... would really like to get it done if at all possible. |
Did not make it in 2.10, but hoping to add in 2.11. Basic plan the same wrt |
Now implemented: see https://github.com/FasterXML/jackson-jr/tree/master/jr-annotation-support for more details on usage, supported annotations. |
To allow JSON tag names to NOT match field names, setters, and getters.
Ex:
Where a JSON object contains a tag like this: "name": "John",
It would properly populate a field in a class like this:
Note that the field, setter ,and getter do NOT match the JSON tag name.
The text was updated successfully, but these errors were encountered: