Thinking about YAML types, wondering how they fit in a wholistic sense
of YAML. Types seem foreign in a way, being defined "out there". So I
was wondering if they could be brough "inside" somehow. In other
words, could it be possible to use YAML to define a type? Well you
sort of see it with Kwaify, albiet that defines a schema for a
document. But surely it could also do the same for just a bit of a
document? So I try this example:
---
customer: !type
type: map
mapping:
name:
type: str
required: yes
email:
type: str
pattern: /@/
age:
type: int
birth:
type: date
customer1: !customer
name: John Doe
email: john@...
age: 31
birth: 1974-10-10
Make senses, but there is a problem here with the name customer being
both form and function within the same document. I.e. What if you
needed a custmer named customer? So does the type definition need to
be in a directive? How might that work?
T.