carueda / tscfg

Boilerplate-free, type-safe access to configuration properties in Java and Scala
Apache License 2.0
107 stars 18 forks source link

Having a List of Strings in the Config does not create the List in the generated Class #259

Closed recalcitrant closed 10 months ago

recalcitrant commented 10 months ago

Describe the bug Putting an Array of Strings in my application.conf throws an error, it seems that somehow the system cannot parse Arrays of Strings or any other kind.

To Reproduce Steps to reproduce the behavior:

  1. Here's the input config schema: ... application { { validItems: ["de", "en", "fr"] } }

  2. Generate wrapper as follows: ... mvn clean install

  3. See error Using the generated class in my code an Exception is thrown: "No configuration setting found for key 'validItems'" Expected behavior I expect the generated class to contain a List of Strings coming from the validItems config e.g. List validItems = Arrays.asList(new String[]{"de", "en", "fr"});

Target language(s):

recalcitrant commented 10 months ago

Instantiating the generated class without passing a sub-path to the ConfigFactory's load method made it work :-)