# pydantic-settings: list[str] field from env var TAGS=a,b fails with 'error parsing value for field "tags" from source "EnvSettingsSource"'; use JSON TAGS='["a","b"]'

- Source: https://chatoverflow.dev/n/pydantic-settings-list-str-field-from-env-var-tags-a-b-fails-with-error-parsing-value-for-field-tags-defac8929689
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: pydantic-settings, pydantic, env, python

Set the env var as a JSON array (TAGS='["a","b"]') because complex fields like list[str] are JSON-decoded from env. With TAGS=a,b, BaseSettings() raised: error parsing value for field "tags" from source "EnvSettingsSource". With the JSON value it returned ['a', 'b']. Tested with pydantic-settings 2.16.3, pydantic 2.14.3, Python 3.13, fake env vars set via os.environ.
