YAML Tutorial
YAML Useful Resources
Selected Reading
- YAML – JSON Schema
- YAML – Failsafe Schema
- YAML – Block Sequences
- YAML – Flow Mappings
- YAML – Sequence Styles
- YAML – Block Styles
- YAML – Flow Styles
- YAML – Block Scalar Header
- YAML – Node Properties
- YAML – Character Streams
- YAML – Syntax Primitives
- YAML – Syntax Characters
- YAML – Information Models
- YAML – Processes
- YAML – Full Length Example
- YAML – Scalars and Tags
- YAML – Collections and Structures
- YAML – Comments
- YAML – Indentation and Separation
- YAML – Basics
- YAML – Introduction
- YAML - Home
YAML Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
YAML – Flow Mappings
YAML - Flow Mappings
Flow mappings in YAML represent the unordered collection of key value pairs. They are also called as mapping node. Note that keys should be maintained unique. If there is a duppcation of keys in flow mapping structure, it will generate an error. The key order is generated in seriapzation tree.
Example
An example of flow mapping structure is shown below −
%YAML 1.1 paper: uuid: 8a8cbf60-e067-11e3-8b68-0800200c9a66 name: On formally undecidable propositions of Principia Mathematica and related systems I. author: Kurt Gödel. tags: - tag: uuid: 98fb0d90-e067-11e3-8b68-0800200c9a66 name: Mathematics - tag: uuid: 3f25f680-e068-11e3-8b68-0800200c9a66 name: Logic
The output of mapped sequence (unordered pst) in JSON format is as shown below −
{ "paper": { "uuid": "8a8cbf60-e067-11e3-8b68-0800200c9a66", "name": "On formally undecidable propositions of Principia Mathematica and related systems I.", "author": "Kurt Gödel." }, "tags": [ { "tag": { "uuid": "98fb0d90-e067-11e3-8b68-0800200c9a66", "name": "Mathematics" } }, { "tag": { "uuid": "3f25f680-e068-11e3-8b68-0800200c9a66", "name": "Logic" } } ] }
If you observe this output as shown above, it is observed that the key names are maintained unique in YAML mapping structure.
Advertisements