PrefectHQ
prefect
BlogDocsChangelog

fix: remove return type annotation from settings serializer to fix OpenAPI schema

#19616
Comparing
fix/settings-serializer-openapi-schema
(
4103fcb
) with
main
(
63d071d
)
CodSpeed Performance Gauge
0%
Untouched
2
Ignored
6

Benchmarks

Passed

bench_import_prefect_flow
benches/bench_import.py
CodSpeed Performance Gauge
0%
1.4 s1.4 s
bench_task_decorator
benches/bench_tasks.py
CodSpeed Performance Gauge
0%
465.1 µs464.9 µs

Ignored

bench_flow_decorator
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
+11%
6.7 ms6.1 ms
bench_import_prefect
benches/bench_import.py
Ignored
CodSpeed Performance Gauge
0%
1.1 s1.1 s
bench_task_call
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
+1%
164.9 ms163.1 ms
bench_flow_call[options1]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
-2%
107.6 ms109.9 ms
bench_task_submit
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
-3%
5.4 ms5.6 ms
bench_flow_call[options0]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
-3%
167.8 ms172.1 ms

Commits

Click on a commit to change the comparison range
Base
main
63d071d
+0.15%
fix: remove return type annotation from settings serializer to fix OpenAPI schema The `@model_serializer(mode='wrap')` decorator with a return type annotation (e.g., `-> Any`) causes Pydantic to generate an empty serialization schema. This breaks OpenAPI schema generation in FastAPI 0.120+, which uses serialization mode for response models. Removing the return type annotation allows Pydantic to fall back to the model schema, producing correct OpenAPI definitions for all settings types. Also updated UI type references to use the non-suffixed schema types (e.g., `HistoryResponse` instead of `HistoryResponse-Output`) since the fix removes the need for separate Input/Output schema variants. See: https://github.com/pydantic/pydantic/issues/8791 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
4103fcb
11 hours ago
by zzstoatzz
© 2025 CodSpeed Technology
Home Terms Privacy Docs