paulschwarz / spring-dotenv

Provides a Dotenv property source for Spring
MIT License
325 stars 23 forks source link

Support for list elements #8

Closed amoriarty closed 2 years ago

amoriarty commented 2 years ago

Hello,

First of all thanks for this library. It has radically change our processes and pipelines because we now can configure our container really simply !

I may have miss something, but is there a way to configure a list with the library ?

For example if I have a list of possible urls like:

urls:
    - https://github.com
    - https://google.com

I would like to configure all of it with environment.

A possible way to do it could with the index in the environment variables:

URLS_0=https://github.com
URLS_1=https://google.com
paulschwarz commented 2 years ago

Hi Alexandre, I'm glad the library is working out for you.

Regarding the list approach, when I look at what others are doing, the recurring theme seems to be covered by this page https://www.baeldung.com/spring-inject-arrays-lists

Please take a look and let me know what you think.