YAML (YAML Ain't Markup Language)
YAML เป็นภาษาซีเรียลไลเซชันข้อมูลที่เป็นมิตรกับมนุษย์ ใช้การเยื้องเพื่อแสดงโครงสร้าง เป็นรูปแบบที่นิยมสำหรับไฟล์การตั้งค่าใน DevOps, Kubernetes และไปป์ไลน์ CI/CD
ประเภท MIME
application/x-yaml
ประเภท
ข้อความ
การบีบอัด
ไม่สูญเสียคุณภาพ
ข้อดี
- + Highly readable — minimal syntax noise
- + Supports comments for inline documentation
- + Native in Docker, Kubernetes, Ansible, and CI/CD systems
- + Superset of JSON — any JSON is valid YAML
ข้อเสีย
- − Indentation-sensitive — whitespace errors cause silent failures
- − Implicit type coercion can cause bugs ('yes' becomes boolean true)
- − More complex specification than JSON with anchors, tags, and directives
เมื่อใดควรใช้ .YAML
ใช้ YAML สำหรับไฟล์การตั้งค่า ไปป์ไลน์ CI/CD การจัดการคอนเทนเนอร์ และข้อมูลที่มีโครงสร้างที่ต้องแก้ไขด้วยมือ
รายละเอียดทางเทคนิค
YAML ใช้การเยื้อง (ช่องว่าง ไม่ใช่แท็บ) สำหรับการซ้อน เครื่องหมายโคลอนสำหรับคู่คีย์-ค่า และเครื่องหมายขีดสำหรับรายการ รองรับสตริง ตัวเลข บูลีน null ลำดับ และแมป
ประวัติ
Clark Evans, Ingy dot Net และ Oren Ben-Kiki สร้าง YAML ในปี 2001 ชื่อแบบเรียกซ้ำย่อมาจาก 'YAML Ain't Markup Language' YAML 1.2 (2009) ทำให้เป็นซูเปอร์เซตของ JSON
แปลงจาก .YAML
แปลงเป็น .YAML
รูปแบบที่เกี่ยวข้อง
คำศัพท์ที่เกี่ยวข้อง
Learn More
JSON vs YAML vs TOML: Choosing a Configuration Format
Configuration files are the backbone of modern applications. JSON, YAML, and TOML each offer different trade-offs between readability, complexity, and …
How to Format and Validate JSON Data
Malformed JSON causes silent failures in APIs and configuration files. Learn how to format, validate, and debug JSON documents to …
Base64 Encoding: How It Works and When to Use It
Base64 converts binary data into ASCII text, making it safe for transmission through text-based systems. Learn when Base64 is the …
Best Practices for Working with Unix Timestamps
Unix timestamps provide a language-agnostic way to represent points in time, but they come with pitfalls around time zones, precision, …
Troubleshooting JWT Token Issues
JSON Web Tokens are widely used for authentication but can be frustrating to debug. This guide covers common JWT problems …
Hash Functions Compared: MD5, SHA-1, SHA-256, and Beyond
Hash functions are used for file integrity, password storage, and digital signatures. This comparison covers the most common algorithms, their …