Skip to content

Commit 2df1eb0

Browse files
committed
parser / property / correct recursive ref detection logic
1 parent 47adea9 commit 2df1eb0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

openapi_python_client/parser/properties/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ def build_schemas(
613613
recursive_references_waiting_reprocess: Dict[str, Union[oai.Reference, oai.Schema]] = dict()
614614
visited: Set[_ReferencePath] = set()
615615
depth = 0
616+
616617
# References could have forward References so keep going as long as we are making progress
617618
while still_making_progress:
618619
still_making_progress = False
@@ -626,11 +627,12 @@ def build_schemas(
626627
schemas.errors.append(PropertyError(detail=ref_path.detail, data=data))
627628
continue
628629

629-
visited.add(ref_path)
630630
schemas_or_err = update_schemas_with(
631631
ref_path=ref_path, data=data, schemas=schemas, visited=visited, config=config
632632
)
633633
if isinstance(schemas_or_err, PropertyError):
634+
visited.add(ref_path)
635+
634636
if isinstance(schemas_or_err, RecursiveReferenceInterupt):
635637
up_schemas = schemas_or_err.schemas
636638
assert isinstance(up_schemas, Schemas) # TODO fix typedef in RecursiveReferenceInterupt

0 commit comments

Comments
 (0)