- 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 - Failsafe Schema
A YAML schema is defined as a combination of set of tags and includes a mechanism for resolving non-specific tags. The failsafe schema in YAML is created in such a manner that it can be used with any YAML document. It is also considered as a recommended schema for a generic YAML document.
Types
There are two types of failsafe schema: Generic Mapping and Generic Sequence
Generic Mapping
It represents an associative container. Here, each key is unique in the association and mapped to exactly one value. YAML includes no restrictions for key definitions.
An example for representing generic mapping is given below −
Clark : Evans Ingy : döt Net Oren : Ben-Kiki Flow style: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki }
The output of generic mapping structure in JSON format is shown below −
{ "Oren": "Ben-Kiki", "Ingy": "du00f6t Net", "Clark": "Evans", "Flow style": { "Oren": "Ben-Kiki", "Ingy": "du00f6t Net", "Clark": "Evans" } }
Generic Sequence
It represents a type of sequence. It includes a collection indexed by sequential integers starting with zero. It is represented with !!seq tag.
Clark : Evans Ingy : döt Net Oren : Ben-Kiki Flow style: !!seq { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki }
The output for this generic sequence of failsafe
schema is shown below: { "Oren": "Ben-Kiki", "Ingy": "du00f6t Net", "Clark": "Evans", "Flow style": { "Oren": "Ben-Kiki", "Ingy": "du00f6t Net", "Clark": "Evans" } }Advertisements