Fix CORS_ORIGINS env parsing crash (pydantic-settings NoDecode), bump 0.1.1

list[str] settings fed from env were JSON-decoded by pydantic-settings
before the field validator ran, so a plain string like
CORS_ORIGINS=http://host:5009 raised JSONDecodeError on startup.
Annotate list env fields with NoDecode and parse CSV/JSON in the validator.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
menzelj
2026-06-07 16:20:36 +00:00
co-authored by Claude Opus 4.8
parent 21f2852259
commit 7775128c07
2 changed files with 17 additions and 7 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ async def lifespan(app: FastAPI):
yield
app = FastAPI(title="StackPilot", version="0.1.0", lifespan=lifespan)
app = FastAPI(title="StackPilot", version="0.1.1", lifespan=lifespan)
app.add_middleware(
CORSMiddleware,