eo-yaml icon indicating copy to clipboard operation
eo-yaml copied to clipboard

Help: about the format

Open xiran2018 opened this issue 2 years ago • 4 comments

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? WX20220914-021128@2x

I want to generate the following file, how can i change my code?

2

xiran2018 avatar Sep 13 '22 18:09 xiran2018

@xiran2018 thank you for reporting this. I'll assign someone to take care of it soon.

zoeself avatar Sep 13 '22 18:09 zoeself

@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.

zoeself avatar Sep 13 '22 18:09 zoeself

Anyone can help me?

xiran2018 avatar Sep 14 '22 07:09 xiran2018

@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?

amihaiemil avatar Sep 14 '22 07:09 amihaiemil

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.

amihaiemil avatar Nov 26 '22 14:11 amihaiemil