Skip to content
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 mapper feature to allow explicitly named properties to be renamed with PropertyNamingStrategy #918

Merged
merged 2 commits into from Sep 10, 2015

Conversation

dharaburda
Copy link
Contributor

The fix for [#428] made a change to prevent explicitly named properties (ones that have JsonProperty("explicitName") for example) from being renamed by a configured PropertyNamingStrategy, however sometimes this behavior may be desirable.

This simple change adds a mapper feature (disabled by default of course) that allows this behavior.

@dharaburda
Copy link
Contributor Author

If accepted, it would be great if this could make into a 2.6.x release (assuming 2.7 is further out?) I'm also happy to update any docs if someone points me to the right place.

@cowtowncoder
Copy link
Member

Looks good to me. Unfortunately it can not be added in 2.6, since it is addition to API, which is something patch releases should not do (because it'd mean that patches are not fully API compatible etc -- but this is just a rule we follow), but makes sense for 2.7.

So, I'd be happy to merge this contribution.

One practical thing we will need now is the Contributor License Agreement (from https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf).
It is needed before the first contribution, but not needed afterwards.
Most developers print it, fill, sign, scan and email to info at fasterxml dot com. If you could do that it would be great; apologies for the hassle, but this is the only part of formal process we have. :)

Looking forward to merging this feature!

@dharaburda
Copy link
Contributor Author

No problem regarding 2.7. I have e-mailed the signed agreement. Thanks!

@cowtowncoder
Copy link
Member

Looks good to me, CLA received, merging.

cowtowncoder added a commit that referenced this pull request Sep 10, 2015
Add mapper feature to allow explicitly named properties to be renamed with PropertyNamingStrategy
@cowtowncoder cowtowncoder merged commit df8b4b1 into FasterXML:master Sep 10, 2015
@cowtowncoder cowtowncoder added this to the 2.7.0 milestone Sep 10, 2015
@cowtowncoder
Copy link
Member

Beautiful. It also gave me an idea of a follow-up feature to perhaps implement; will file the issue next, link to this one.

@cowtowncoder
Copy link
Member

So, #926 is for adding property in @JsonNaming to override this global setting on per-type basis.
Not sure how easy that'd be to implement, but seems like something that would be useful both for enforcing renaming on just some types, and for possibly preventing that (if default was to allow).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants