Browse Source
This commit introduces a fast-path for the jsonable_encoder and directly uses TypeAdapter(Any).dump_json() and dump_python() in astapi.routing and astapi.encoders. By leveraging the Rust-based pydantic-core directly, serialization overhead for complex types is significantly reduced. - Use TypeAdapter(Any).dump_json() in _serialize_data and _serialize_sse_item - Add fast-path to jsonable_encoder to use TypeAdapter(Any).dump_python(mode='json') - Update test_sse_events_with_fields to account for minified JSON output of Pydantic v2pull/15584/head
3 changed files with 25 additions and 5 deletions
Loading…
Reference in new issue