Skip to content

YamlSequence: print without extra newLine #545

@treblereel

Description

@treblereel

first of all, thank you for sure a great project ! I really love it!

So according to our specs, we should emit complex sequences without extra newLine like this:

- item    : Super Hoop
  quantity: 1
- item    : Basketball
  quantity: 4
- item    : Big Shoes
  quantity: 1

but i can't find out how to achive it:

    YamlSequenceBuilder sequence = Yaml.createYamlSequenceBuilder();

    YamlMappingBuilder compactNestedMapping = Yaml.createYamlMappingBuilder();
    compactNestedMapping = compactNestedMapping.add("item", "Super Hoop");
    compactNestedMapping = compactNestedMapping.add("quantity", "1");

    sequence = sequence.add(compactNestedMapping.build());

always produce :

-
  item: Super Hoop
  quantity: 1

i am totally sure, i do something wrong

Thanks for any ideas

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions