-
Notifications
You must be signed in to change notification settings - Fork 55
Conversation
If enabled will use a literal block style for string containing newlines. All other quotes are unaffected. This make sense in addition to MINIMIZE_QUOTES and ALWAYS_QUOTE_NUMBER_AS_STRINGS as e.g this is safer for string values like "true" (which when quotes are stripped mutate from a string type to a boolean type). It is false by default.
* Whether for string containing newlines a <a href="http://www.yaml.org/spec/1.2/spec.html#style/block/literal">literal block style</a> | ||
* should be used. This automatically enabled when {@link #MINIMIZE_QUOTES} is set. | ||
* <p> | ||
* The content of such strinfs is limited to printable characters according to the rules of |
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.
typo: strinfs
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.
thanks :)
Something which is probably be a bug and should be tackled differently: When a string has the value "false" or "true" then quotes should never be removed, even when Nevertheless I think this PR has still its value (even when the boolean-issue is resolved), since stripping quotes from scalars and using a multiline-syntax for strings with newlines are also two different use cases. If the would no backwards compatibility issues, I would even remove the literal quoting style from MINIMIZE_QUOTES. |
Opened #77 for the boolean content issue and pushed corresponding PR #78 |
@rhuss I'll go ahead and merge this, but needs to go in 2.9 being a new feature (API change). Thanks again! |
cool, thx ! Do you have a rough estimate when 2.9 will be available ? |
@rhuss unfortunately not yet. But typically we have done 2 minor releases per year, and official release would either be before christmas season (vacation), or early january. And the first release candidate at least month before. So |
This PR upgrade com.fasterxml.jackson.dataformat:jackson-dataformat-yaml to version 2.8.4 which contains the bugfix FasterXML/jackson-dataformat-yaml#78 for not unquoting strings which contain boolean values. When 2.9 is out then this should be taken along with the then new feature LITERAL_BLOCK_STYLE (instead of MINIMIZE_QUOTES). See FasterXML/jackson-dataformat-yaml#76 for details.
Update: |
If enabled will use a literal block style for string containing newlines. All other quotes are unaffected.
This make sense in addition to MINIMIZE_QUOTES and ALWAYS_QUOTE_NUMBER_AS_STRINGS as it is a separate feature (see comment below)
The feature is set to false by default.