From 526ca78e790bf8ff09b717a0db055cb35ee1f8c6 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 30 Jul 2023 01:19:11 +0800 Subject: [PATCH] add tests for #16199 (python client) (#16220) --- samples/openapi3/client/petstore/python/tests/test_model.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/samples/openapi3/client/petstore/python/tests/test_model.py b/samples/openapi3/client/petstore/python/tests/test_model.py index 2598b0757d0..7cbe124bfc4 100644 --- a/samples/openapi3/client/petstore/python/tests/test_model.py +++ b/samples/openapi3/client/petstore/python/tests/test_model.py @@ -508,3 +508,8 @@ 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(). + def test_first_ref(self): + # shouldn't throw "still a ForwardRef" error + a = petstore_api.FirstRef.from_dict({}) + self.assertEqual(a.to_json(), "{}") +