forked from loafle/openapi-generator-original
[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:
@@ -104,9 +104,6 @@ class Animal(BaseModel):
|
||||
|
||||
from petstore_api.models.cat import Cat
|
||||
from petstore_api.models.dog import Dog
|
||||
from typing import TYPE_CHECKING
|
||||
if TYPE_CHECKING:
|
||||
# TODO: pydantic v2
|
||||
# Animal.model_rebuild()
|
||||
pass
|
||||
# TODO: Rewrite to not use raise_errors
|
||||
Animal.model_rebuild(raise_errors=False)
|
||||
|
||||
|
||||
@@ -90,9 +90,6 @@ class CircularReferenceModel(BaseModel):
|
||||
return _obj
|
||||
|
||||
from petstore_api.models.first_ref import FirstRef
|
||||
from typing import TYPE_CHECKING
|
||||
if TYPE_CHECKING:
|
||||
# TODO: pydantic v2
|
||||
# CircularReferenceModel.model_rebuild()
|
||||
pass
|
||||
# TODO: Rewrite to not use raise_errors
|
||||
CircularReferenceModel.model_rebuild(raise_errors=False)
|
||||
|
||||
|
||||
@@ -90,9 +90,6 @@ class DummyModel(BaseModel):
|
||||
return _obj
|
||||
|
||||
from petstore_api.models.self_reference_model import SelfReferenceModel
|
||||
from typing import TYPE_CHECKING
|
||||
if TYPE_CHECKING:
|
||||
# TODO: pydantic v2
|
||||
# DummyModel.model_rebuild()
|
||||
pass
|
||||
# TODO: Rewrite to not use raise_errors
|
||||
DummyModel.model_rebuild(raise_errors=False)
|
||||
|
||||
|
||||
@@ -90,9 +90,6 @@ class FirstRef(BaseModel):
|
||||
return _obj
|
||||
|
||||
from petstore_api.models.second_ref import SecondRef
|
||||
from typing import TYPE_CHECKING
|
||||
if TYPE_CHECKING:
|
||||
# TODO: pydantic v2
|
||||
# FirstRef.model_rebuild()
|
||||
pass
|
||||
# TODO: Rewrite to not use raise_errors
|
||||
FirstRef.model_rebuild(raise_errors=False)
|
||||
|
||||
|
||||
@@ -90,9 +90,6 @@ class SecondRef(BaseModel):
|
||||
return _obj
|
||||
|
||||
from petstore_api.models.circular_reference_model import CircularReferenceModel
|
||||
from typing import TYPE_CHECKING
|
||||
if TYPE_CHECKING:
|
||||
# TODO: pydantic v2
|
||||
# SecondRef.model_rebuild()
|
||||
pass
|
||||
# TODO: Rewrite to not use raise_errors
|
||||
SecondRef.model_rebuild(raise_errors=False)
|
||||
|
||||
|
||||
@@ -90,9 +90,6 @@ class SelfReferenceModel(BaseModel):
|
||||
return _obj
|
||||
|
||||
from petstore_api.models.dummy_model import DummyModel
|
||||
from typing import TYPE_CHECKING
|
||||
if TYPE_CHECKING:
|
||||
# TODO: pydantic v2
|
||||
# SelfReferenceModel.model_rebuild()
|
||||
pass
|
||||
# TODO: Rewrite to not use raise_errors
|
||||
SelfReferenceModel.model_rebuild(raise_errors=False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user