Skip to content

Commit a953222

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#153)
1 parent 2d5a6ea commit a953222

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cloudflare/_models.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,15 @@ def is_basemodel_type(type_: type) -> TypeGuard[type[BaseModel] | type[GenericMo
290290
return issubclass(origin, BaseModel) or issubclass(origin, GenericModel)
291291

292292

293-
def construct_type(*, value: object, type_: type) -> object:
293+
def construct_type(*, value: object, type_: object) -> object:
294294
"""Loose coercion to the expected type with construction of nested values.
295295
296296
If the given value does not match the expected type then it is returned as-is.
297297
"""
298+
# we allow `object` as the input type because otherwise, passing things like
299+
# `Literal['value']` will be reported as a type error by type checkers
300+
type_ = cast("type[object]", type_)
301+
298302
# unwrap `Annotated[T, ...]` -> `T`
299303
if is_annotated_type(type_):
300304
meta = get_args(type_)[1:]

0 commit comments

Comments
 (0)