Skip to content

Commit f677ba9

Browse files
committed
WIP
1 parent e12703a commit f677ba9

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/serializers/type_serializers/nested_model.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ impl BuildSerializer for NestedModelSerializer {
5050

5151
impl NestedModelSerializer {
5252
fn nested_serializer<'py>(&self, py: Python<'py>) -> Bound<'py, SchemaSerializer> {
53+
self.model
54+
.bind(py)
55+
.call_method(intern!(py, "model_rebuild"), (), None)
56+
.unwrap();
57+
5358
self.model
5459
.getattr(py, intern!(py, "__pydantic_serializer__"))
5560
.unwrap()

src/validators/nested_model.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ impl Validator for NestedModelValidator {
4848
input: &(impl Input<'py> + ?Sized),
4949
state: &mut ValidationState<'_, 'py>,
5050
) -> ValResult<PyObject> {
51+
self.model
52+
.bind(py)
53+
.call_method(intern!(py, "model_rebuild"), (), None)
54+
.unwrap();
55+
5156
let validator = self
5257
.model
5358
.getattr(py, intern!(py, "__pydantic_validator__"))

0 commit comments

Comments
 (0)