Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse arrays from env vars to JSON #126

Open
JAlbertoGonzalez opened this issue Aug 8, 2021 · 0 comments
Open

Parse arrays from env vars to JSON #126

JAlbertoGonzalez opened this issue Aug 8, 2021 · 0 comments

Comments

@JAlbertoGonzalez
Copy link

My JSON config needs an array as one of its params.

I'm unable to set that param from the env vars.

Example:

My JSON is:

{
  "customconfig": {
    "arrayparam": []
  }
}

If I use:

prefix_customconfig_arrayparam=example

Result is:

{
  "customconfig": {
    "arrayparam": "example"
  }
}

If I use:

prefix_customconfig_arrayparam__0=example1
prefix_customconfig_arrayparam__1=example2

I get:

{
  "customconfig": {
    "arrayparam": {
      "0": "example1",
      "1": "example2"
    }
  }
}

Is there any way to parse envs params to arrays?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant