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

Can't parse an empty array with the env parser #443

Open
gurinderu opened this issue Jul 19, 2023 · 0 comments
Open

Can't parse an empty array with the env parser #443

gurinderu opened this issue Jul 19, 2023 · 0 comments

Comments

@gurinderu
Copy link

gurinderu commented Jul 19, 2023

I am trying to parse a vec key with Env (with env TEST_KEY__LIST = "") source like

Environment::with_prefix("TEST")
        .try_parsing(true)
        .prefix_separator("_")
        .separator("__")
        .list_separator(",")
        .with_list_parse_key("test_key.enable")
struct Config {
  test_key: TestKey
}

enum Test {
  One,
  Two
}

struct TestKey {
  enable: Vec<Test>
}

and I see

invalid type: string "", expected a sequence

I assume that the empty string should be parsed as an empty array

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