Skip to content

Commit 1d88d07

Browse files
committed
Fix required in path check
1 parent 9ac2678 commit 1d88d07

File tree

1 file changed

+4
-2
lines changed
  • openapi_python_client/parser/properties

1 file changed

+4
-2
lines changed

openapi_python_client/parser/properties/union.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
from itertools import chain
4-
from typing import Any, ClassVar
4+
from typing import Any, ClassVar, cast
55

66
from attr import define, evolve
77

@@ -172,7 +172,9 @@ def get_lazy_imports(self, *, prefix: str) -> set[str]:
172172

173173
def validate_location(self, location: oai.ParameterLocation) -> ParseError | None:
174174
"""Returns an error if this type of property is not allowed in the given location"""
175+
from ..properties import Property
176+
175177
for inner_prop in self.inner_properties:
176-
if inner_prop.validate_location(location) is not None:
178+
if evolve(cast(Property, inner_prop), required=self.required).validate_location(location) is not None:
177179
return ParseError(detail=f"{self.get_type_string()} is not allowed in {location}")
178180
return None

0 commit comments

Comments
 (0)