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 MapperFeature.ALLOW_COERCION_OF_SCALARS for enabling/disabling coercions #1106

Closed
cowtowncoder opened this issue Jan 29, 2016 · 0 comments
Milestone

Comments

@cowtowncoder
Copy link
Member

cowtowncoder commented Jan 29, 2016

(see #200 for background; #1095 also)

While existing features should cover cases of allowing (or not) of coercion from null to primitive (FAIL_ON_NULL_FOR_PRIMITIVES), as well as coercion from empty String to primitive via null (as per #1095), there is no way to block other coercions from JSON Strings (primarily) or, in case of boolean/Boolean, from integral numbers.

To allow preventing such coercions, it would make sense to add yet another DeserializationFeature, named something like ALLOW_COERCION_FOR_SCALARS, defaulting to true to keep current behavior as the baseline.

@cowtowncoder cowtowncoder changed the title (2.8) Add DeserializationFeature.ALLOW_COERCION_FOR_SCALARS (2.8) Add DeserializationFeature value ALLOW_COERCION_FOR_SCALARS Jan 30, 2016
@cowtowncoder cowtowncoder changed the title (2.8) Add DeserializationFeature value ALLOW_COERCION_FOR_SCALARS Add DeserializationFeature value ALLOW_COERCION_FOR_SCALARS May 25, 2016
@cowtowncoder cowtowncoder changed the title Add DeserializationFeature value ALLOW_COERCION_FOR_SCALARS Add DeserializationFeatures ACCEPT_EMPTY_STRING_AS_SCALAR, ALLOW_COERCION_FOR_SCALARS Mar 19, 2017
@cowtowncoder cowtowncoder changed the title Add DeserializationFeatures ACCEPT_EMPTY_STRING_AS_SCALAR, ALLOW_COERCION_FOR_SCALARS Add DeserializationFeature.ALLOW_COERCION_FOR_SCALARS for enabling/disabling coercions Mar 31, 2017
@cowtowncoder cowtowncoder changed the title Add DeserializationFeature.ALLOW_COERCION_FOR_SCALARS for enabling/disabling coercions Add MapperFeature.ALLOW_COERCION_OF_SCALARS for enabling/disabling coercions Mar 31, 2017
@cowtowncoder cowtowncoder added this to the 2.9.0.pr3 milestone Mar 31, 2017
cowtowncoder added a commit that referenced this issue Apr 1, 2017
cowtowncoder added a commit that referenced this issue Apr 10, 2017
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

No branches or pull requests

1 participant