Overview
Litestar 2.20, released on February 8, 2026, improves DTO schemas and fixes CORS issues.
Main Features
DTO schemas
DTO (Data Transfer Object) schemas benefit from more precise automatic generation and better OpenAPI documentation.
python
from litestar import Litestar, post
from litestar.dto import DTOConfig
from dataclasses import dataclass
@dataclass
class Article:
id: int
title: str
content: str
@post('/articles', dto=DTOConfig(exclude={'id'}))
async def create(data: Article) -> Article:
return data
CORS fixes
Several CORS fixes improve preflight header handling and compatibility with modern browsers.
