Avatar for the pydantic user
pydantic
pydantic
BlogDocsChangelog

Fix serialization schema generation when using `PlainValidator`

#10427Merged
Comparing
10385
(
1fb016f
) with
main
(
cf671c8
)
CodSpeed Performance Gauge
0%
Improvements
0
Regressions
0
Untouched
48
New
0
Dropped
0
Ignored
2

Benchmarks

Passed

test_simple_model_validation[__init__]
tests/benchmarks/test_model_validation.py::test_simple_model_validation[__init__]
CodSpeed Performance Gauge
+1%
42.9 µs
42.5 µs
test_simple_model_validation[model_validate]
tests/benchmarks/test_model_validation.py::test_simple_model_validation[model_validate]
CodSpeed Performance Gauge
+1%
44 µs
43.7 µs
test_complex_model_validation[model_validate]
tests/benchmarks/test_model_validation.py::test_complex_model_validation[model_validate]
CodSpeed Performance Gauge
0%
57.3 µs
57.2 µs
test_construct_schema
tests/benchmarks/test_model_schema_generation.py::test_construct_schema
CodSpeed Performance Gauge
0%
4.9 ms
4.9 ms
test_isinstance_basemodel
tests/benchmarks/test_isinstance.py::test_isinstance_basemodel
CodSpeed Performance Gauge
0%
26.4 ms
26.3 ms
test_import_basemodel
tests/benchmarks/test_imports.py::test_import_basemodel
CodSpeed Performance Gauge
0%
84.2 µs
84.1 µs
test_custom_field_serializer_plain
tests/benchmarks/test_model_schema_generation.py::test_custom_field_serializer_plain
CodSpeed Performance Gauge
0%
1.3 ms
1.3 ms
test_north_star_json_loads
tests/benchmarks/test_north_star.py::test_north_star_json_loads
CodSpeed Performance Gauge
0%
22.7 ms
22.7 ms
test_north_star_validate_python_strict
tests/benchmarks/test_north_star.py::test_north_star_validate_python_strict
CodSpeed Performance Gauge
0%
30 ms
29.9 ms
test_fastapi_startup_perf
tests/benchmarks/test_fastapi_startup_simple.py::test_fastapi_startup_perf
CodSpeed Performance Gauge
0%
31 ms
31 ms
test_north_star_validate_python
tests/benchmarks/test_north_star.py::test_north_star_validate_python
CodSpeed Performance Gauge
0%
44.6 ms
44.6 ms
test_custom_field_serializer_wrap
tests/benchmarks/test_model_schema_generation.py::test_custom_field_serializer_wrap
CodSpeed Performance Gauge
0%
1.4 ms
1.3 ms
test_custom_model_serializer_decorator
tests/benchmarks/test_model_schema_generation.py::test_custom_model_serializer_decorator
CodSpeed Performance Gauge
0%
1.3 ms
1.3 ms
test_list_of_models_validation[model_validate]
tests/benchmarks/test_model_validation.py::test_list_of_models_validation[model_validate]
CodSpeed Performance Gauge
0%
97.5 µs
97.4 µs
test_complex_model_validation[__init__]
tests/benchmarks/test_model_validation.py::test_complex_model_validation[__init__]
CodSpeed Performance Gauge
0%
57.7 µs
57.6 µs
test_custom_serializer_wrap_annotated
tests/benchmarks/test_model_schema_generation.py::test_custom_serializer_wrap_annotated
CodSpeed Performance Gauge
0%
1.6 ms
1.6 ms
test_recursive_model_schema_generation
tests/benchmarks/test_model_schema_generation.py::test_recursive_model_schema_generation
CodSpeed Performance Gauge
0%
1.9 ms
1.9 ms
test_north_star_validate_json_strict
tests/benchmarks/test_north_star.py::test_north_star_validate_json_strict
CodSpeed Performance Gauge
0%
53.1 ms
53.1 ms
test_simple_model_serialization
tests/benchmarks/test_model_serialization.py::test_simple_model_serialization
CodSpeed Performance Gauge
0%
34.5 µs
34.5 µs
test_nested_model_schema_generation
tests/benchmarks/test_model_schema_generation.py::test_nested_model_schema_generation
CodSpeed Performance Gauge
0%
3.5 ms
3.5 ms
test_north_star_validate_json
tests/benchmarks/test_north_star.py::test_north_star_validate_json
CodSpeed Performance Gauge
0%
53.3 ms
53.3 ms
test_north_star_json_dumps
tests/benchmarks/test_north_star.py::test_north_star_json_dumps
CodSpeed Performance Gauge
0%
24.3 ms
24.3 ms
test_custom_wrap_field_validator_via_annotation
tests/benchmarks/test_model_schema_generation.py::test_custom_wrap_field_validator_via_annotation
CodSpeed Performance Gauge
0%
1.4 ms
1.4 ms
test_custom_wrap_field_validator_via_decorator
tests/benchmarks/test_model_schema_generation.py::test_custom_wrap_field_validator_via_decorator
CodSpeed Performance Gauge
0%
1.4 ms
1.4 ms
test_north_star_dump_json
tests/benchmarks/test_north_star.py::test_north_star_dump_json
CodSpeed Performance Gauge
0%
31.3 ms
31.3 ms
test_north_star_dump_python
tests/benchmarks/test_north_star.py::test_north_star_dump_python
CodSpeed Performance Gauge
0%
17 ms
17 ms
test_custom_model_validator_after
tests/benchmarks/test_model_schema_generation.py::test_custom_model_validator_after
CodSpeed Performance Gauge
0%
1.3 ms
1.3 ms
test_model_json_serialization
tests/benchmarks/test_model_serialization.py::test_model_json_serialization
CodSpeed Performance Gauge
0%
65.9 µs
65.9 µs
test_simple_model_schema_generation
tests/benchmarks/test_model_schema_generation.py::test_simple_model_schema_generation
CodSpeed Performance Gauge
0%
1.5 ms
1.5 ms
test_custom_field_validator_via_decorator[after]
tests/benchmarks/test_model_schema_generation.py::test_custom_field_validator_via_decorator[after]
CodSpeed Performance Gauge
0%
1.4 ms
1.4 ms
test_lots_of_models_with_lots_of_fields
tests/benchmarks/test_model_schema_generation.py::test_lots_of_models_with_lots_of_fields
CodSpeed Performance Gauge
0%
4.4 s
4.4 s
test_custom_model_validator_before
tests/benchmarks/test_model_schema_generation.py::test_custom_model_validator_before
CodSpeed Performance Gauge
0%
1.3 ms
1.3 ms
test_fastapi_startup_perf
tests/benchmarks/test_fastapi_startup_generics.py::test_fastapi_startup_perf
CodSpeed Performance Gauge
0%
253.8 ms
253.9 ms
test_nested_model_validation[__init__]
tests/benchmarks/test_model_validation.py::test_nested_model_validation[__init__]
CodSpeed Performance Gauge
0%
60.3 µs
60.3 µs
test_custom_field_validator_via_annotation[BeforeValidator]
tests/benchmarks/test_model_schema_generation.py::test_custom_field_validator_via_annotation[BeforeValidator]
CodSpeed Performance Gauge
0%
1.4 ms
1.4 ms
test_complex_model_schema_generation
tests/benchmarks/test_model_schema_generation.py::test_complex_model_schema_generation
CodSpeed Performance Gauge
0%
3.3 ms
3.4 ms
test_custom_model_validator_wrap
tests/benchmarks/test_model_schema_generation.py::test_custom_model_validator_wrap
CodSpeed Performance Gauge
0%
1.3 ms
1.3 ms
test_custom_field_validator_via_annotation[AfterValidator]
tests/benchmarks/test_model_schema_generation.py::test_custom_field_validator_via_annotation[AfterValidator]
CodSpeed Performance Gauge
0%
1.4 ms
1.4 ms
test_nested_model_validation[model_validate]
tests/benchmarks/test_model_validation.py::test_nested_model_validation[model_validate]
CodSpeed Performance Gauge
0%
56.4 µs
56.4 µs
test_list_of_models_validation[__init__]
tests/benchmarks/test_model_validation.py::test_list_of_models_validation[__init__]
CodSpeed Performance Gauge
0%
100 µs
100.1 µs
test_efficiency_with_highly_nested_examples
tests/benchmarks/test_discriminated_unions.py::test_efficiency_with_highly_nested_examples
CodSpeed Performance Gauge
0%
973.6 µs
975 µs
test_schema_build
tests/benchmarks/test_discriminated_unions.py::test_schema_build
CodSpeed Performance Gauge
0%
3.5 ms
3.6 ms
test_custom_serializer_plain_annotated
tests/benchmarks/test_model_schema_generation.py::test_custom_serializer_plain_annotated
CodSpeed Performance Gauge
0%
1.5 ms
1.5 ms
test_import_field
tests/benchmarks/test_imports.py::test_import_field
CodSpeed Performance Gauge
0%
83.1 µs
83.3 µs
test_complex_model_serialization
tests/benchmarks/test_model_serialization.py::test_complex_model_serialization
CodSpeed Performance Gauge
0%
61.7 µs
61.9 µs
test_list_of_models_serialization
tests/benchmarks/test_model_serialization.py::test_list_of_models_serialization
CodSpeed Performance Gauge
0%
62.5 µs
62.7 µs
test_custom_field_validator_via_decorator[plain]
tests/benchmarks/test_model_schema_generation.py::test_custom_field_validator_via_decorator[plain]
CodSpeed Performance Gauge
-2%
1.5 ms
1.5 ms
test_custom_field_validator_via_annotation[PlainValidator]
tests/benchmarks/test_model_schema_generation.py::test_custom_field_validator_via_annotation[PlainValidator]
CodSpeed Performance Gauge
-2%
1.4 ms
1.5 ms

Ignored

test_custom_field_validator_via_decorator[before]Ignored
tests/benchmarks/test_model_schema_generation.py::test_custom_field_validator_via_decorator[before]
CodSpeed Performance Gauge
0%
1.5 ms
1.5 ms
test_nested_model_serializationIgnored
tests/benchmarks/test_model_serialization.py::test_nested_model_serialization
CodSpeed Performance Gauge
0%
44.2 µs
44.2 µs

Commits

Click on a commit to change the comparison range
Base
main
cf671c8
-1%
Fix serialization schema generation when using `PlainValidator` Do not hardcode a new wrap serializer schema if a serialization schema was already generated before.
0026fcb
7 months ago
by Viicos
+1%
feedback
f561620
7 months ago
by Viicos
0%
add xfail
1fb016f
7 months ago
by Viicos
© 2025 CodSpeed Technology
Home Terms PrivacyDocs