2026-05-19 · 1 मिनट पढ़ाई
config files के लिए YAML और JSON
वह format चुनें जो runtime पढ़ता है; convert तभी जब दोनों sides control में हों।
YAMLJSONconfig
मुख्य बिंदु
- YAML comments और anchors blind JSON round-trip survive नहीं करते।
- main commit से पहले converted JSON validate करें।
format चुनना
hand-edited configs with comments के लिए YAML; strict parsers और generated artifacts के लिए JSON.
repo boundaries (human YAML → machine JSON) पर convert, हर local save पर नहीं।
Safe conversion workflow
YAML ⇄ JSON में paste, diff inspect, result पर JSON Validator चलाएँ.
API specs के लिए JSON OpenAPI document हो तो OpenAPI Validator follow करें.
अक्सर पूछे जाने वाले प्रश्न
conversion numbers या booleans बदलता है?
हाँ — quotes और types matter. output हमेशा diff करें और CI में app parser चलाएँ।
Kubernetes YAML use करता है — JSON store करूँ?
humans के लिए git में YAML; JSON तभी generate जब downstream tool require करे।