raml-js-parser icon indicating copy to clipboard operation
raml-js-parser copied to clipboard

extending with yaml anchors

Open reesew opened this issue 9 years ago • 2 comments

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)

reesew avatar Sep 03 '15 20:09 reesew

Only scalar map keys are allowed afaik.

sichvoge avatar Jul 28 '16 15:07 sichvoge

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

reesew avatar Jul 28 '16 16:07 reesew