| 1 |
--- |
| 2 |
title: What is wrong with explicit tags? |
| 3 |
--- |
| 4 |
|
| 5 |
Explicit tags are tags that have an explicit type attached that is used to determine what type to convert the data to when it is parsed. |
| 6 |
|
| 7 |
For example, if it were to be applied to "fix" the Godfather movie script parsing issue described above, it would look like this: |
| 8 |
|
| 9 |
```yaml |
| 10 |
- Don Corleone: Do you have faith in my judgment? |
| 11 |
- Clemenza: !!str Yes |
| 12 |
- Don Corleone: Do I have your loyalty? |
| 13 |
``` |
| 14 |
|
| 15 |
Explicit typecasts in YAML markup are slightly confusing for non-programmers, much like the concept of 'types' in general. StrictYAML's philosophy is that types should be kept strictly separated from data, so this 'feature' of YAML is switched off. |
| 16 |
|
| 17 |
If tags are seen in a YAML file it will raise a special TagTokenDisallowed exception. |
| 18 |
|
| 19 |
|
| 20 |
## Counterpoints |
| 21 |
|
| 22 |
- [Valid usage in AWS cloudformation syntax?](https://github.com/crdoconnor/strictyaml/issues/37) |