You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ideally, a comment above a key in the same indentation level stays with the key. If it is the same indentation level as the previous element, keep it below that one.
Can this be done in Jackson with dataformat-yaml?
The text was updated successfully, but these errors were encountered:
But this has come up multiple times, and I think we have some existing issues.
One big problem is that it is very difficult to preserve comment content in JsonNode (or similar) since they can exist anywhere within content model. So while adding ability read/write comments at low level (parser/generator) is quite possible, we have nothing to do that at higher level(s).
So this is the problem to resolve.
Also affects XML, fwtw, and likely other formats (TOML at least? even some binary formats; albeit nothing with schema).
Yes, I suspected this much. I will wonder how to deal with that in tools that consume and auto-sort YAML, maybe do replacements after saving files. Thanks for your quick confirmation! 👍🏻
Hi,
Description
currently I am using Jackson with dataformat-yaml to sort my yaml files by key:
Now, comments will get lost regardless of which method I use to read and write the document.
SnakeYAML features
However, with SnakeYAML alone you could do something like this:
Wishlist
Ideally, a comment above a key in the same indentation level stays with the key. If it is the same indentation level as the previous element, keep it below that one.
Can this be done in Jackson with dataformat-yaml?
The text was updated successfully, but these errors were encountered: