Dump with BLOCK & setIndicatorIndent(2) makes wrong YAML on list of maps

Issue #358 resolved
Former user created an issue

You can check it with 1.17 version:

import org.yaml.snakeyaml.*
DumperOptions options = new DumperOptions();
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
options.setIndicatorIndent(2)
return new Yaml(options).dump({some:[{db_1:"ds",name:"asd"},{db_2:"daas",name:"adas"}]})

Input:

some:
  - db_1: ds
    name: asd
  - db_2: daas
    name: adas

Will produce output:

some:
  -
  db_1: ds
  name: asd
  -
  db_2: daas
  name: adas

Seems like we need to move map block according to indicator indent value.

Thank you.

Comments (2)

  1. Log in to comment