YAML
YAML Ain't Markup Language
YAML (YAML Ain't Markup Language) คือรูปแบบการจัดลำดับข้อมูลที่ออกแบบให้อ่านง่ายสำหรับมนุษย์ ใช้การเยื้อง (indentation) แทนวงเล็บเพื่อกำหนดโครงสร้าง ใช้อย่างแพร่หลายสำหรับไฟล์การตั้งค่า, CI/CD pipelines และ infrastructure as code
รายละเอียดทางเทคนิค
YAML ใช้การเยื้อง 2 ช่องว่าง (ห้ามใช้ tab) เพื่อกำหนดลำดับชั้น รองรับ: scalar (string, number, boolean, null, datetime), sequence (รายการ), mapping (คู่คีย์-ค่า) และ anchors (&)/aliases (*) สำหรับการอ้างอิง YAML เป็น superset ของ JSON (JSON ที่ valid คือ YAML ที่ valid) MIME type คือ application/yaml ข้อควรระวัง: "Norway problem" (NO ถูกแปลงเป็น false ใน YAML 1.1 — แก้ไขแล้วใน YAML 1.2)
ตัวอย่าง
```javascript
// YAML: web API example
const response = await fetch('/api/resource');
const data = await response.json();
console.log(data);
```