Thanks for the help …


> Binary encoding... sorry. YAML is first and foremost about readability.

The idea is to have both canonical human readable and binary encodings.  It’s pretty straight forward to define a TLV approach that simply takes a tag and converts it to an enumerated integer.  YAML as it stands could have such an efficient encoding with a suitable definition of ways to do tag mapping.  A Schema could help define the tag to integer mapping (ASN.1 or Protobuf as examples).


I’ll sent a sample schema to the list as it gets put together …






From: Oren Ben-Kiki []
Sent: Friday, June 10, 2011 12:30 PM
To: Paul Lambert
Subject: Re: [Yaml-core] Reg: PyYAML grammar


There hasn't been much work on YAML schemas. There is an issue here that people mean different things when they say "schema" and "validation".


If you are looking for validating your specific input files in your specific application, YAML is very well suited for that. A minimal amount of !tag-ing combined with some implicit tagging rules, plus adding verification code in the matching classes in your favorite implementation language, and you are all set for as strong (or as weak) a verification as you want. This is what most people do.


If you are looking for a generic "validate a data file with a schema file" ability. There's no such thing for YAML, perhaps because it isn't that useful in practice after all...


The same arguments can be made about JSON, except there you are completely at the mercy of "implicit" tagging, and the whole notion of deserialization into your application classes is an afterthought rather than being an inherent part of the spec.


Binary encoding... sorry. YAML is first and foremost about readability. Sure, you can produce pretty dense (and unreadable) YAML files using the flow styles (think JSON but with the !tag-ing, such as [!foo{bar: baz}]. That's not _too_ bad size-wise, as long as all your data is textual anyway - and you can zip it for additional shrinkage. If you have true binary data (e.g., a PNG image), you'd need to base-64 it, and zipping the result would only help so far... YAML really wasn't designed for this sort of thing.


Have fun,


    Oren Ben-Kiki


On Fri, Jun 10, 2011 at 9:52 PM, Paul Lambert <> wrote:

So … I’ve only recently joined and been tracking this list, so please excuse what might be off-topic.


I’m working on a security standard and trying to use YAML.  However, I need a schema – not to enforce a schema on YAML, but  primarily to be able to describe in YAML subsets of a possible schema.


The standard is focused on describing “who can do what”. Who is cryptographic, what can be objects describable in YAML.  Delegation requires the ability to define set of information within a schema.


I’ve looked at Doctrine – it’s close but not quite what I need. Are there other efforts in place that could be leveraged?


I’m also looking at stronger typing and binary encoding (akin to Protobuf).  The use of schemas, strong types and alternate encodings may be contrary to YAML culture and goals (of staying simple).  Is YAML the right choice in this context or should I just start something new that is YAML-like?


Thanks in advance,






EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
Yaml-core mailing list