YAML(YAML Ain't Markup Language)
YAMLは、インデントで構造を表現する人間にやさしいデータシリアライゼーション言語です。DevOpsツール(Docker Compose、Kubernetes、Ansible、GitHub Actions)の設定ファイルとして好まれ、JSONのスーパーセットです。
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を使うタイミング
設定ファイル、CI/CDパイプライン、コンテナオーケストレーション、人間が編集する構造化データにYAMLを使用してください。
技術的詳細
YAMLはネストにインデント(タブではなくスペース)、キー・バリューペアにコロン、リスト項目にハイフンを使用します。データ再利用のためのアンカー(&)とエイリアス(*)、複数行文字列、コメントをサポートします。
歴史
Clark Evans、Ingy döt Net、Oren Ben-Kikiが2001年にYAMLを作成しました。再帰的な名前は「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 …