Releases: litestar-org/litestar
v2.2.0
💰 Sponsors 💰
GitHub Sponsors: @benjamin-kirkbride @crisog
OpenCollective: Christian Y, Anonymous
What's Changed
Bugfixes
- Fix #2381 - Objects converted to
bool
in debug response by @geeshta in #2384 - Fix #2358: Re-export filters and exceptions from advanced-alchemy by @provinzkraut in #2360
- Fix: Re-Add missing
create_engine()
method to SQLAlchemy configs by @peterschutt in #2382 - Fix #2368 - before_request handler modifies handler signature by @provinzkraut in #2391
- Fix #1301 - Ensure compression is applied before response caching by @provinzkraut in #2393
- Don't implicitly parse URL encoded form data as JSON by @provinzkraut in #2394
New features
- Enable CLI by default by @lsanpablo in #2346
- Allow customization of Pydantic integration by @cofin in #2404
- Add
/schema/openapi.yml
to the available schema paths by @JacobCoffee in #2411 - Add experimental
DTOCodegenBackend
by @provinzkraut in #2388 - Improve error messages for missing required parameters by @provinzkraut in #2418
Other changes
- (typing): app
listeners
param typed asSequence
. by @peterschutt in #2366 - Lazy import example creator by @provinzkraut in #2390
Documentation
- Remove stale hooks #2375 by @JacobCoffee in #2377
- Update
url
topath
inRedirect
to resolve #2407 by @JacobCoffee in #2410 - Add section for
DTOCodegenBackend
by @provinzkraut in #2415 - Fix
docs/usage/testing
indentation by @Lancetnik in #2425
New Contributors
- @lsanpablo made their first contribution in #2346
- @hyperknot made their first contribution in #2420
- @Lancetnik made their first contribution in #2425
Full Changelog: v2.1.1...v2.2.0
v2.1.1
💰 Sponsors 💰
GitHub Sponsors: @benjamin-kirkbride @crisog
OpenCollective: Christian Y, GitHub Sponsors, Shubham Prajapati, Snyk
What's Changed
Bugfixes
- Fix
DeprecationWarning
raised byResponse.to_asgi_response
by @provinzkraut in #2364
Full Changelog: v2.1.0...v2.1.1
v2.1.0
💰 Sponsors 💰
GitHub Sponsors: @benjamin-kirkbride @crisog
OpenCollective: Christian Y, GitHub Sponsors, Shubham Prajapati, Snyk
🎉 New Contributors 🎉
- @ddxv made their first contribution in #2194
- @juan-riveros made their first contribution in #2191
- @davidbrochart made their first contribution in #2247
- @sean-donoghue made their first contribution in #2259
- @sykloid made their first contribution in #2277
- @benjamin-kirkbride made their first contribution in #2276
- @wevonosky made their first contribution in #2268
- @geeshta made their first contribution in #2298
- @RobertRosca made their first contribution in #2329
What's Changed
➕ Features
- feat: make
302
the defaultstatus_code
for redirect responses by @cofin
in #2189 - feat(layered-include_in_schema): Add include_in_schema option for all layers by @Alc-Alc
in #2295 - feat(deprecation): Adds deprecation warnings for
app
parameter when usingto_asgi_response
method of responses by @wevonosky
in #2268
🔢 Features: Extras
- feat(contrib-jwt): Add parameters to set the JWT
extras
field by @dialvarezs
in #2313 - feat(templates): add possibility to customize jinja environment by @euri10 in #2195
- feat(templates): add minjinja by @euri10 in #2250
📅 Features: SQLAlchemy
- feat(sqlalchemy): exclude implicit fields for sqlalchemy dto by @abdulhaq-e in #2170
- feat(sqlalchemy): allow repository functions to be filter by expressions by @cofin
in #2265 - feat(sqlalchemy): use
lambda_stmt
in the repository by @cofin in #2179 - feat(sqlalchemy): swap to the
advanced_alchemy
implementations by @cofin
in #2312
📚 Docs
- docs: updates htmx docs by @cofin in #2202
- docs(DTO): Replace PartialDataDTO with DTOData by @ddxv in #2194
- docs: update benchmarks by @provinzkraut in #2198
- docs: add
app
to events usage example by @juan-riveros in #2191 - docs(responses): fix cookie example reference by @aorith in #2215
- docs(security): incorrect argument to Litestar by @aorith in #2220
- docs: fix typo by @davidbrochart in #2247
- docs: Miscellaneous fixes by @sean-donoghue in #2259
- docs: Add
litestar-fullstack
to README and docs by @odiseo0 in #2284 - docs: Fix async sessions, Pydantic V2 by @geeshta in #2298
- docs(templates): Add missing sync_to_thread for examples by @provinzkraut
in #2309 - docs(signature-namespace): Fix code block to render without removing the imports by @Alc-Alc
in #2326 - docs: docs/update links by @RobertRosca in #2329
🔧 Fixes
- fix: remove usages of deprecated ExceptionHandlerMiddleware
debug
parameter by @provinzkraut
in #2192 - fix: raise ValidationException when pydantic validation fails by @guacs
in #2204 - fix: set the max width of the console to the standard terminal width of 80. This helps prevent line wrapping in
certain cases. by @cofin in #2244 - fix(schema): handling of optional path parameters by @Goldziher in #2224
- fix: use os.replace instead of shutil.move for renaming file by @guacs
in #2223 - fix: Exception detail attribute by @gsakkis in #2231
- fix(sqlalchemy-repo): #2221 - Filters not available in
exists()
by @nielsvanhooy
in #2228 - fix: add pydantic types to sqlalchemy registry only if pydantic is installed by @guacs
in #2252 - fix: don't add content type for responses that don't have a body by @guacs
in #2263 - fix:
SQLAlchemyPlugin
refactored. by @cofin in #2269 - fix: Ensure app-dir is appended to path during autodiscovery. by @sykloid
in #2277 - fix: set content length header by default by @guacs in #2271
- fix: #2196 - incorrect handling of mutable headers in ASGIResponse by @provinzkraut
in #2308 - fix: adds missing ORM registry export by @cofin in #2316
- fix: bump version of advanced_alchemy by @cofin in #2317
- fix: discrepency in attrs, msgspec and pydantic for multi-part forms by @euri10
in #2280 - fix: set proper default for
exclude_http_methods
in auth middleware by @guacs
in #2325 - fix(tests): fix platform compat tests by @provinzkraut in #2310
- fix(tests):
RedisStore
test fortime-machine
2.13.0 by @provinzkraut
in #2342
🏛️ Misc / Infra / Tests / Other
- build: ignore all-contributorsrc from pre-commit prettier by @cofin
in #2201 - refactor(structure): move the repository module from contrib to top-level by @Goldziher
in #2238 - infra: Publish with PyPI's trusted publishers by @provinzkraut in #2306
- test: use stricter pytest config by @sobolevn in #2327
- test: use
xfail_strict
for pytest config by @sobolevn in #2328 - test: fix
pydantic@v2
deprecation warning in tests by @sobolevn
in #2340 - test: silence
ResourceWarning
intest_file_response
by @sobolevn
in #2331
Full Changelog: v2.0.0...v2.0.2x
v2.0.1
💰 Sponsors 💰
GitHub Sponsors: @benjamin-kirkbride @crisog
OpenCollective: Christian Y, GitHub Sponsors, Shubham Prajapati, Snyk
What's Changed
🔧 Fixes
- Fix warnings about deprecated
debug
parameter ofExceptionHandlerMiddleware
by @provinzkraut in #2193
Full Changelog: v2.0.0...v2.0.1
v2.0.0
This marks the first release of the new 2.x
release line. The 1.5x
releases will be supported until the release of 3.0
. Nevertheless, users are encouraged to upgrade to version 2.
What's Changed
Bugfixes
- Fix #2024 -
media_type
missing in error response by @Goldziher in #2131 - Fix #2147 - setting app debug does not propagate to exception handling middleware by @provinzkraut in #2153
- Fix static files not being served if a route handler with the same base path was registered by @Goldziher in #2154
- Fix missing default values for
receive
andsend
parameters ofHTMXRequest
by @tompin82 in #2145 - DTO: Fix #2125 - excluded attributes being accessed during transfer by @provinzkraut in #2127
- DTO: Fix
DTOData.create_instance
ignores renaming by @abdulhaq-e in #2144 - OpenAPI: Fix
application/octet-stream
set ascontentEncoding
instead ofcontentMediaType
@Goldziher in #2130 - OpenAPI: Fix response not preferring aliased fields by @gsakkis in #2150
- OpenAPI: Fix examples not being generated deterministically by @Goldziher in #2161
- OpenAPI: Fix example generation for Pydantic models by @guacs in #2178
- SQLAlchemy repository: Handle dialects that don't support JSON by @thiagozf in #2139
- JWT: Fix
OPTIONS
andHEAD
being authenticated by default by @Goldziher in #2160 - Fix
OPTIONS
andHEAD
being authenticated by default forSessionAuthMiddleware
by @Mattwmaster58 in #2182
New Contributors
- @thiagozf made their first contribution in #2139
- @Mattwmaster58 made their first contribution in #2143
Full Changelog: v2.0.0rc1...v2.0.0
v2.0.0rc1
What's Changed
🎉 New Contributors 🎉
- @mj0nez made their first contribution in #2036
- @therealzanfar made their first contribution in #2058
New features
- Server-sent events by @Goldziher in #2035
- SQLAlchemy repository: allow specifying
id_attribute
per method by @cofin in #2052 - SQLAlchemy repository:
upsert_many
by @cofin in #2056 - SQLAlchemy repository: New filters
OnBeforeAfter
,NotInCollectionFilter
andNotInSearchFilter
by @cofin in #2057 - SQLAlchemy repository: Configurable chunk sizing for
delete_many
by @cofin in #2061 - SQLAlchemy repository: Support
InstrumentedAttribute
for attribute columns by @provinzkraut in #2054 - OpenAPI: support callable
operation_id
on route handlers by @Goldziher in #2078 - Run event listeners concurrently by @provinzkraut in #2083
- Plugin registry by @provinzkraut in #2096
- CLI plugins by @provinzkraut in #2066
Bugfixes
- SQLAlchemy repository:
health_check
generates valid statement for oracle by @cofin in #2060 - Fix serialization of empty strings in multipart form by @Goldziher in #2044
- Fix #2033 - Server-side session middleware overrides CSRF cookies by @provinzkraut in #2069
- Fix base path escaping in channels on Windows by @provinzkraut in #2112
- DTO: Support renamed fields in
DTOData
andcreate_instance
by @abdulhaq-e in #2065
Other changes
- Switch test clients to
debug=True
by default by @Goldziher in #2049 - BREAKING: remove deprecated module
partial.py
by @provinzkraut in #2113 - BREAKING: remove deprecated modules
dto/factory
andcontrib/msgspec
by @provinzkraut in #2114
Changes to DTOs
BREAKING
This release introduces significant changes to the DTOs. This was necessary to address some bugs that came about because of some issues with the previous internal design. Unfortunately, these changes could not be made backwards compatible, but they are mostly superficial changes to the interfaces; Functionally DTOs still work the same.
The following breaking changes were introduced:
DTOInterface
has been removedForType
has been removedAbstractDTOFactory
has been renamed toAbstractDTO
Full Changelog: v2.0.0beta4...v2.0.0rc1
v1.51.14
What's Changed
- fix(v1.51): #1948 passing wrapper class to struct logging config causes pydantic exception by @JacobCoffee in #2105
Full Changelog: v1.51.13...v1.51.14
v2.0.0beta4
What's Changed
Bugfix release containing a workaround for a bug in poetry that caused development / extra dependencies to be installed alongside the package.
This was fixed by @Goldziher in #2029.
Full Changelog: v2.0.0beta3...v2.0.0beta4
v2.0.0beta3
Highlights
As of this release, Pydantic is an optional dependency.
What does that mean?
For you as an end user, not much; It is still supported in the same capacity as before, it's just not required anymore.
We have migrated all of our internals that previously relied on Pydantic (mainly for parsing and validation) to the amazing msgspec library, with Pydantic now being handled by an internal plugin.
The important thing is: Everything that has worked before with Pydantic will continue to work, and if you're not using Pydantic, but instead want to use attrs or pure msgspec, you won't have a required Pydantic dependency anymore.
Pydantic 2 support
Another change related to Pydantic is that this release adds support for Pydantic 2, which offers lots of improvements, new features and performance gains. Pydantic 1 is still fully supported and will be for the foreseeable future.
What's Changed
New features
- DTO: Support piccolo ORM with
PiccoloDTO
by @Goldziher in #1896 - DTO: Add
include
option toDTOConfig
by @Goldziher in #1950 - SQLAlchemyDTO: column/relationship type inference by @peterschutt in #1879
- SQLAlchemy repository: New
auto_commit
,auto_refresh
andauto_expunge
options by @cofin in #1900 - Allow customization of
OpenAPIController.path
fromOpenAPIConfig
by @jaykv in #1886 - Include path name in
ImproperlyConfiguredException
message for missing param type by @euri10 in #1935
Bugfixes
- Breaking SQLAlchemy repository: Fix spanner support by renaming the
_sentinel
column tosa_orm_sentinel
by @cofin in #1933 - SQLAlchemy repository: Fix audit columns
created_at
andupdated_at
defaulting to app startup time by @MatthewNewland in #1894 - SQLAlchemyDTO: Fix handling of
Sequence
with defaults by @peterschutt in #1883 - DTO / OpenAPI: Fix detection of required fields for Pydantic and msgspec by @abdulhaq-e in #1946
- Allow JSON as redirect response by @cofin in #1908
Other changes
- Breaking Pin Redis to
>=4.4.4+
version by @Goldziher in #1903 - Breaking Replace
Header
,CacheControlHeader
andETag
Pydantic models with dataclasses by @Tsdevendra1 in #1917 - Breaking
dto.factory.abc.AbstractDTOFactory
moved todto.factory.base.AbstractDTOFactory
by @Goldziher in #1950 - Breaking Make Pydantic an optional extra by @Goldziher in #1963
- Pydantic 2 support by @Goldziher in #1956
- Deprecation of
partial
module by @Goldziher in #2002
New Contributors
- @jaykv made their first contribution in #1886
- @Tsdevendra1 made their first contribution in #1917
- @euri10 made their first contribution in #1935
- @su-shubham made their first contribution in #1930
- @erik-hasse made their first contribution in #1938
- @sobolevn made their first contribution in #1954
Full Changelog: v2.0.0beta2...v2.0.0beta3
v1.51.13
What's Changed
- Restrict Pydantic to
<2
by @provinzkraut in #1985
Full Changelog: v1.51.12...v1.51.13