vert-x3 / vertx-config

Vert.x Configuration Service
Apache License 2.0
54 stars 64 forks source link

Add a "raw-data" option for processing properties files #38

Closed jessym closed 6 years ago

jessym commented 6 years ago

This is already implemented for Environment Variables. From the documentation:

... By default, the retrieved value are transformed into JSON compatible structures (number, string, boolean, json object and json array). To avoid this conversion, configure the raw-data attribute:

ConfigStoreOptions json = new ConfigStoreOptions()
  .setType("env")
  .setConfig(new JsonObject().put("raw-data", true));

For example, I have an API key in my properties file which looks like this

6134789540453672

But it is read like Integer.MAX_VALUE for some reason

2147483647

which could be avoided if there was an option to read all values as strings.

cescoffier commented 6 years ago

I've added the feature for system properties and property files. The doc has been updated.