From 962ea8bf21be6f6852fa34be0f878395a331d3a4 Mon Sep 17 00:00:00 2001 From: Amin Alaee Date: Tue, 5 Jul 2022 20:04:46 +0200 Subject: [PATCH] Add docs for defining upper-case variables on nested setting models (#4153) --- docs/usage/settings.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/usage/settings.md b/docs/usage/settings.md index fd1447a..3867add 100644 --- a/docs/usage/settings.md +++ b/docs/usage/settings.md @@ -56,6 +56,10 @@ so in this example all upper-case, you should name attribute all upper-case too. You can still name environment variables anything you like through `Field(..., env=...)`. +In Pydantic **v1** `case_sensitive` is `False` by default and all variable names are converted to lower-case internally. +If you want to define upper-case variable names on nested models like `SubModel` you have to +set `case_sensitive=True` to disable this behaviour. + !!! note On Windows, Python's `os` module always treats environment variables as case-insensitive, so the `case_sensitive` config setting will have no effect - settings will always be updated ignoring case.