raml-org / raml-js-parser

(deprecated) A RAML parser based on PyYAML written in CoffeScript and available for use as NodeJs module or in-browser.
195 stars 53 forks source link

extending with yaml anchors #158

Open reesew opened 9 years ago

reesew commented 9 years ago

I can't use yaml's ability to extend objects defined earlier, I get an error only scalar map keys are allowed in RAML. Here's an example:

extendable: &extendable
  inherited: prop
extended:
  <<: *extendtable
  extra: prop0
items:
  - <<: *extendable
    extra: prop1
  - <<: *extendable
    extra: prop2

which should expand to

...
extended:
  inherited: prop
  extra: prop0
items:
  - inherited: prop
    extra: prop1
  - inherited: prop
    extra: prop2

Is it really true that only scalar map keys are allowed for RAML? Or is it just that the parser doesn't know how to handle the <<: key? (I am not even sure whether << is a scalar or not)

sichvoge commented 8 years ago

Only scalar map keys are allowed afaik.

reesew commented 8 years ago

ok, but the <<: *foo functionality is valid yaml, so, is there a way to get that fixed?