Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Add new feature LITERAL_BLOCK_STYLE #76

Merged
merged 2 commits into from
Oct 13, 2016
Merged

Conversation

rhuss
Copy link
Contributor

@rhuss rhuss commented Oct 11, 2016

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.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: strinfs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks :)

@rhuss
Copy link
Contributor Author

rhuss commented Oct 11, 2016

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 MINIMIZE_QUOTES is enabled.

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.

@rhuss
Copy link
Contributor Author

rhuss commented Oct 11, 2016

Opened #77 for the boolean content issue and pushed corresponding PR #78

@cowtowncoder
Copy link
Member

@rhuss I'll go ahead and merge this, but needs to go in 2.9 being a new feature (API change). Thanks again!

@cowtowncoder cowtowncoder merged commit b280169 into FasterXML:master Oct 13, 2016
@rhuss
Copy link
Contributor Author

rhuss commented Oct 13, 2016

cool, thx ! Do you have a rough estimate when 2.9 will be available ?

@cowtowncoder
Copy link
Member

@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 2.8.0.rc1 should be out by late November, early December.

rhuss added a commit to rhuss/fabric8-maven-plugin that referenced this pull request Oct 28, 2016
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.
@cowtowncoder
Copy link
Member

Update: 2.9.0.pr1 has been out for a bit, but there will be at least 2.9.0.pr2 before 2.9.0 final.

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

Successfully merging this pull request may close these issues.

3 participants