eo-yaml
eo-yaml copied to clipboard
Help: about the format
1: When I use createYamlMappingBuilder, the format of the generated yaml file is as follows, the horizontal line is above the name, I want the horizontal line and the name to be on the same line, I don't know how to modify it?
2:When I use createYamlMappingBuilder, when there is only one element, no horizontal line is generated, don't know why? How can I add horizontal [lines?
I want to generate the following file, how can i change my code?
@xiran2018 thank you for reporting this. I'll assign someone to take care of it soon.
@amihaiemil I couldn't find any assignee for this task. This is either because there are no contributors with role DEV
available or because the project does not have enough funds.
Please, make sure there is at least one available contributor with the required role and the project can afford to pay them.
Anyone can help me?
@xiran2018
1: When I use createYamlMappingBuilder, the format of the generated yaml file is as follows, the horizontal line is above the name, I want the horizontal line and the name to be on the same line, I don't know how to modify it?
You cannot change the way the YAML is generated, unfortunately. But that format is also a correct YAML.
2:When I use createYamlMappingBuilder, when there is only one element, no horizontal line is generated, don't know why? How can I add horizontal [lines?
The YAML element mapped to proxy-groups
is a Mapping, not a Sequence, that's why it doesn't have any -
. It's also a correct YAML, but maybe you built a mapping, when you wanted to build a sequence?
Closing this, I think the topics are clear. Printing logic cannot be altered at the moment, but you can write your own printer and override the toString methods (decorator pattern), if you really need to.