Codearte / props2yaml

Apache License 2.0
38 stars 17 forks source link

Will it work for lengthy values? #20

Open jayudhandha opened 4 years ago

jayudhandha commented 4 years ago

I am converting it my map into yaml.

Map: {management.endpoints.web.exposure.include= health, info, refresh, shutdown, selftest, listProcessors}

Output of code Props2YAML.fromContent(yaml.dump(Map)).convert()

Expected Output:

management:
  endpoints:
    web:
      exposure:
        include: health, info, refresh, shutdown, selftest, listProcessors

Actual Output:

listProcessors: ''
management:
    endpoints:
        web:
            exposure:
                include: health, info, refresh, shutdown, selftest,

Note:

If i remove listProcessors from the map value than it's working fine.

I tried to play with this map in my sample file with below code

Props2YAML pr = new Props2YAML(yaml.dump(Map));

System.out.println(pr.convert());

This is giving me correct output.

Why i can't make it work with the code Props2YAML.fromContent(yaml.dump(Map)).convert() ?(Which is mentioned in README)

Thanks, Jayesh

jayudhandha commented 4 years ago

Ok I found the issue,

The issue is with the version of snakeyaml. If we download the zip of Props2YAML version 0.5, It contains the snakeyaml version 1.16.

My above issue is being reproduced when we use snakeyaml version 1.24 (In my case)

Above problme is not being reproduced with snakeyaml 1.16 which is being default shipped with the zip