YAML Merge Keys status and implementation
Victor Efimov <[email protected]> Mon, 11 Jan 2016 01:23:31 +0300
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <CAF7QZD4=J4nWyPMW+6OWHx=kdkQ9qLNV+DmeywrJGHyvmRb2Aw@mail.gmail.com> |
Hello.
We've found YAML library, that we use (in fact we tried two: wrappers
based on libyaml and libsyck) does not support "YAML Merge Keys"
feature (a type).
http://yaml.org/type/merge.html
We've made some fixes to wrappers to support this feature and it
worked so far, but recently we found that
the following YAML:
===
_message_title: &_m_title
title: sometitle
_message_text: &_m_text
content: somecontent
items:
-
fixture:
<<: *_m_text
<<: *_m_title
===
Parsed by this online service http://yaml-online-parser.appspot.com/
(I think python library) as:
===
{
"_message_title": {
"title": "sometitle"
},
"_message_text": {
"content": "somecontent"
},
"items": [
{
"fixture": {
"content": "somecontent",
"title": "sometitle"
}
}
]
}
===
and our library+fixes does not support this.
Now we're trying to understand status of Merge Hash draft and level of
support for it, that we should implement..
Questions:
1) I understand that http://yaml.org/type/merge.html is optional, and
a YAML parser is not obligated to support it.
Is this correct? How many YAML implementations support it in the wild, in fact?
2) In above example the following construct (not described in the draft)
(form A)
===
fixture:
<<: *_m_text
<<: *_m_title
===
is parsed by http://yaml-online-parser.appspot.com/. But should it be?
or more correct form would be (and it's described in the draft):
(form B)
===
fixture:
<<: [ *_m_text, *_m_title ]
===
Should/MAY/MUST/MAY-NOT YAML parser (which tends to support Merge
Keys) support the first form (form A)?
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140