breser / git2consul

Mirrors the contents of a git repository into Consul KVs.
Other
763 stars 164 forks source link

Array handling #166

Open mkw opened 6 years ago

mkw commented 6 years ago

This is an attempt to provide support for arrays when expanding keys for JSON and Yaml.

It was motivated by using Consul for Spring Boot services, which allows for array configuration data with either comma-separated lists or property names ending with indexes in [] -- e.g. my/array/key[0]. While the existing loader provided fine support for loading Yaml files un-expanded, we wanted to expand keys in order to observe changes on a per-key level directly from Consul.

I believe that would address the now-closed #71 issue. It builds on the work done by @kapekost for better Yaml support, but adds two new properties to control how arrays are formatted.

These values are described in the readme, and the code is isolated so it could easily be re-used in the discussed refactoring to allow for non-git configuration sources.