-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Most safe/generic/features-wide way to format yaml files #372
Comments
This comment was marked as resolved.
This comment was marked as resolved.
@blacelle I think you are right in that Jackson's support for formatting of every kind of YAML is lacking in areas you mention. I hope over time we can improve some, but fundamental I think you are right in that using SnakeYAML (or, newer I think some things, like handling of multiple documents, are easier than others (comments are actually challenging since they are sort of "fluff", non-data content that can exist anywhere, and Jackson token stream has no way to express them). |
Multiple documents per file is described in #66. It seems to cover our case. |
Yes, and I think #132, fixed in 2.10.2, made it work (for |
About comments, they are discussed here #36. As some point, I thought that by deserializing a String into an For now, comments with Jackson seems not reachable (while SnakeYAML may have recently make this reachable (#36 (comment))) |
About anchors, #120 is relevant but not very active. It suggests (like previous comment about |
Yeah, comments are by far the most difficult ones due to multiple reasons. |
While working on diffplug/spotless#1478, to integrate Jackson as a YAML formatter, I encounter various issues/limitations.
The naive approach was to load a YML as an Object with ObjectMapper.readValue(...), and output right-away with ObjectMapper.writeValueAsString after adding some feature (e.g. INDENT_OUTPUT).
I encounter issues relating to:
Does jackson team has some recommendation for generic
.yaml
formatting? If Jackson is not a good option, would you have any recommanded alternative ? (e.g. stick we SnakeYml).Thanks
The text was updated successfully, but these errors were encountered: