kaml
kaml copied to clipboard
Print YamlNodes
Sorry if this is an unnecessary question, but due to the lack of documentation I am unsure how I would go about constructing a YAML document manually from the different YamlNode
types and then "serialize" it later (like one could do with the typical JsonElement
s).
The only thing I could find was the contentToString()
function, but while this may be fine it does not provide a way to format the resulting output in a pretty manner and customize this behaviour using a YamlConfiguration
.
Again, very sorry if I am just missing this, but I could not find anything like json's JsonElementSerializer
(which is also automatically used by the extension methods with reified type parameters, something that seems missing here too).
Hi @F0Xde, this isn't something that is currently supported. Writing a YamlElementSerializer
similar to the built-in JsonElementSerializer
wouldn't be too difficult - if you're interested in doing this, I'd gladly accept a PR, but I don't have time to add this at the moment.
I just started implemting such a serializer
I created #302, but I'm personally not happy with the implementation and I'll be switching to a different approach anyway, but maybe someone else can pick this up.
This issue has been automatically marked as stale because it has not had any activity in the last 60 days. It will automatically be closed if no further activity occurs in the next seven days to enable maintainers to focus on the most important issues. If this issue is still affecting you, please comment below within the next seven days. Thank you for your contributions.
This issue has been automatically closed because it has not had any recent activity.