[python] add circular reference import (#16940)

* [python] add circular reference import

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

---------

Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ
2023-11-02 23:14:20 +09:00
committed by GitHub
parent 7b8a515dcb
commit 1092593841
16 changed files with 32 additions and 76 deletions

View File

@@ -560,7 +560,6 @@ class ModelTests(unittest.TestCase):
# should not throw the following errors:
# pydantic.errors.ConfigError: field "additional_properties" not yet prepared so type is still a ForwardRef, you might need to call ObjectToTestAdditionalProperties.update_forward_refs().
@unittest.skip("TODO: pydantic v2: fix circular dependencies between CircularReferenceModel, FirstRef, SecondRef")
def test_first_ref(self):
# shouldn't throw "still a ForwardRef" error
a = petstore_api.FirstRef.from_dict({})