-
-
Notifications
You must be signed in to change notification settings - Fork 146
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 YAMLParser.Feature.PARSE_BOOLEAN_LIKE_WORDS_AS_STRINGS
to allow disabling of coercion of Boolean-like Strings
#389
Add YAMLParser.Feature.PARSE_BOOLEAN_LIKE_WORDS_AS_STRINGS
to allow disabling of coercion of Boolean-like Strings
#389
Conversation
yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/YAMLParser.java
Show resolved
Hide resolved
Ok I think this looks fine on first look (I'll need to go over it once more before merging just in case but nothing off so far). So I think I'd like to get it merged. But one (and only) process thing: if I haven't asked for and gotten CLA: https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf yet, it'd be needed before the first contribution (and it's then good for any number of contributions to Jackson project). The usual way is to print it, fill & sign, scan/photo, email to Once I get that I can proceed with merging. Thank you for this contribution & looking forward to merging it! |
Thanks for looking @cowtowncoder! Added the |
CLA received, doing last review now. |
|
||
public void testParseBooleanLikeWordsAsString_enabledFF() throws Exception | ||
{ | ||
YAMLFactory f = new YAMLFactory().enable(YAMLParser.Feature.PARSE_BOOLEAN_LIKE_WORDS_AS_STRINGS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change this to use builder-based configuration, merges more cleanly in master
(3.0 has immutable factories).
YAMLParser.Feature.PARSE_BOOLEAN_LIKE_WORDS_AS_STRINGS
to allow disabling of coercion of Boolean-like Strings
Thanks for the quick turnaround @cowtowncoder, happy to see this merged! Do you by any chance have a rough timeline for when 2.15 might be available? |
@axelniklasson Hoping to get release candidate out in early March (in 2 weeks?), and from that, 3-4 weeks for final release. |
Introduce a new feature flag to
YAMLParser
that when explicitly enabled, leads to the following words (irrespective of case) being parsed as strings instead of booleans:yes
no
off
on
Note that
y
/n
are already parsed as strings and this change will not impact howtrue
andfalse
are being parsed - they will still be parsed as booleans.Fixes #388