tags:

views:

28

answers:

1

Hello, for better organization (for eg: seed and test data), is it possible to split the yaml file and import the first one from second. Of course, the variables in file1 should be available to use in the second. I use Snakeyaml based parser i java, if that matters. thanks.

Update 1: (example)

Seed file: seed.yaml

Priority(L1E1):
    level:          1
    priorityCode:   E1
    description:    Escalation

test data file: test-data.yaml

Request(RER1):
    priority:      L1E1
    title:         Something

So, I need to split the files, as they becoming huge. Also the variable/data (L1E1 in this case) defined in one file needs to be accessible in the second file.

A: 

YAML does not define an "include" directive. What do you mean by "the variables in file1 should be available to use in the second" ? Do you expect anchors and aliases to work across the files ?

sorry, I'm not used to the types available in a yaml file. So, please find an example updated in the qn. thanks.
bsreekanth
Priority(L1E1) is one scalar for YAML. Please use http://instantyaml.appspot.com/ to see the canonical YAML. I am afraid you ask for anchors and aliases, but I am not sure. Please read the spec.
thanks for the link.. It is not too bad to duplicate the data as there is no import (to split files) directive.. thanks.
bsreekanth