Konvertieren von JSON, YAML. Parsen von JSON, YAML

Ich bin das arbeiten mit Konfigurationsdateien, so brauche ich zum konvertieren von JSON, YAML.
Ich habe zum Beispiel yaml-Datei:

{
  "foo": "bar",
  "baz": [ "qux","quxx"],
  "corge": null,
  "grault": 1,
  "garply": true,
  "waldo": "false",
  "fred": "undefined",
  "emptyArray": [],
  "emptyObject": {},
  "emptyString": ""
}

Sollte das Ergebnis yaml:

foo: "bar"
baz: 
  - "qux"
  - "quxx"
corge: null
grault: 1
garply: true
waldo: "false"
fred: "undefined"
emptyArray: []
emptyObject: {}
emptyString: ""

Könnten Sie mir helfen?

InformationsquelleAutor eabyshev | 2014-10-07
Schreibe einen Kommentar