0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

yamlの基本を学ぶ

Posted at

yaml入門

YAML (YAML Ain’t Markup Language) とは、意味的はわかりやすいデータ シリアライズ (serialize) という言語 という言葉になります。

設定ファイルの記述に使用されることが多く、あらゆるプログラミング言語に対応し、よく使われています。

YAML では、エンジニアにとっての使いやすさが重視されて書かれています。

YAMはJSONと違う点は、改行とインデント が明確な意味を持ちます。

YAML は形式的に、設定するものに関して適しています。

YAML の書き方

YAML ファイルの基本構造は、キーと値を組み合わせるだけです。

キー : 値

スカラー

YAMLは、数字や文字列、真偽値など基本的な値を表現できます。

version: 2.0
author: "taihong"
rank: 5
visible : false

シーケンス

YAMLは要素の集合をシーケンスで表現できます。

prefecture:
 - tokyo
 - osaka
 - aichi
 - fukuoka

マッピング

YAMLは、key:value型のコレクションをマッピングとして表現できます。

 prefecture:
  tokyo: 13
  osaka: 27
  aichi: 23
  fukuoka: 40
  
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?