Skip to content

Commit 14f0a5b

Browse files
authored
Merge pull request #425 from sisp/refactor/oneof-anyof-unmarshaller
Create oneOf/anyOf unmarshaller using unmarshallers factory
2 parents df4bbfe + 06c3d02 commit 14f0a5b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

openapi_core/unmarshalling/schemas/unmarshallers.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing import Iterable
77
from typing import List
88
from typing import Optional
9+
from typing import cast
910

1011
from isodate.isodatetime import parse_datetime
1112
from jsonschema._types import is_array
@@ -218,12 +219,9 @@ def unmarshal_raw(self, value: Any) -> Any:
218219
return self._unmarshal_object(value)
219220

220221
def _clone(self, schema: Spec) -> "ObjectUnmarshaller":
221-
return ObjectUnmarshaller(
222-
schema,
223-
self.validator,
224-
self.formatter,
225-
self.unmarshallers_factory,
226-
self.context,
222+
return cast(
223+
"ObjectUnmarshaller",
224+
self.unmarshallers_factory.create(schema, "object"),
227225
)
228226

229227
def _unmarshal_object(self, value: Any) -> Any:

0 commit comments

Comments
 (0)