coolaj86 / yaml2json

A command-line utility to convert a YAML file (.yml) to JSON file (.json)
Apache License 2.0
25 stars 6 forks source link

yaml2json is parsing just a single line-- exits without erro #9

Open niccs opened 8 years ago

niccs commented 8 years ago

Hi,

I am using yaml2json for the first time. My OS is Windows 7 and I am using git bash. May be I am missing something very basic, can you guys please help/guide me here.

I tried sending the output of the bash text processing command to test.yml and I can see the test.yml file is created properly. But once I feed it as a input to yaml2json, it parses just the first line "version" :1 and exits without any error.

However, If I try to convert test.yml file contents online via site:--http://yamltojson.com/-- the resulting .json is proper.

Following are the contents of test.yml file generated:--

version: 1 layout: post lang: en slug: "checklist" type: "modal" title: "Checklist" published: "true" categories: "mobile" tags: "mobile" action:

yaml2jsonconversionimproper yaml2jsonconversiononline

micayael commented 8 years ago

Hi, is there any solution about this?

nicbet commented 8 years ago

For me the solution is to start the .yml file with three dashes "---" and then indent all following lines with at least one tab.

---
    version: 1
    layout: "post"
    lang: "en"
mommi84 commented 5 years ago

I uninstalled package yaml2json and installed yamljs instead. All errors (including a JavaScript heap out of memory) are gone. The file gets also parsed without the --- at the beginning.