diff --git a/flask_restx/model.py b/flask_restx/model.py index 1b2f7b7d..1706988d 100644 --- a/flask_restx/model.py +++ b/flask_restx/model.py @@ -175,7 +175,7 @@ def _schema(self): return not_none(definition) - @cached_property + @property def resolved(self): """ Resolve real fields before submitting them to marshal diff --git a/tests/test_fields.py b/tests/test_fields.py index 09b7e271..2633b7fc 100644 --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -1336,6 +1336,15 @@ def data(cls): "owner": {"name": "child2", "model": "Child2", "extra2": "extra2"} } + assert data(Child1) == { + "owner": {"name": "child1", "model": "Child1", "extra1": "extra1"} + } + + assert data(Child2) == { + "owner": {"name": "child2", "model": "Child2", "extra2": "extra2"} + } + + class CustomFieldTest(FieldTestCase): def test_custom_field(self):