-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
environment variables are not parsed as JSON when missing specified env_prefix #510
Comments
In your example, probably a duplicate of #441 Here is the doc: |
Note that the problem exists for both OS environment variables and .env variables, I don't think this is just a .env parsing problem? Also, I updated my model_config to use |
I think it is only for dotenv. by the following code:
Here is the output:
You can see I got a validation error in the second case that I removed the prefix.
in case of dotenv as I mentioned in my previous comment, |
Gotcha. You're right, this boils down to being a duplicate of #441 |
Reproduction code is here
My model is specified as:
If I set an environment variable WITH a prefix it gets parsed as a list and works fine:
If I set an environment variable WITHOUT a prefix it picks up the environment variable but interprets it as a string rather than a list and fails validation:
Error is:
The text was updated successfully, but these errors were encountered: