javanile / yamlinc

Compose multiple YAML files into one with $include tag. Split Swagger/OpenAPI into multiple YAML files.
MIT License
114 stars 24 forks source link

Fixes issue with using $include for individual array elements #23

Closed gcox closed 4 years ago

gcox commented 5 years ago

Individual array elements could be included from external files prior to this by formatting the original file like so:

array:
  -
    $include: el0.yml
  -
    $include: el1.yml

A prettier format like the following would effectively be a no-op b/c the regex for matching the $include tag only allowed for it to be prefixed by white space:

array:
  - $include: el0.yml
  - $include: el1.yml

This change updates the regex to also allow for the include tag to be prefixed by '-', which allows for the nicer format above to work.

brokenmass commented 4 years ago

@francescobianco : can we get this PR merged please ?

francescobianco commented 4 years ago

@brokenmass @gcox Sorry by the later approval. Thanks for your support. Please give stars and ask for stars to your friends.