|
26 | 26 | OAuth2ClientCredential, |
27 | 27 | ) |
28 | 28 |
|
| 29 | +type _JSONValue = ( |
| 30 | + bool | int | float | str | list[_JSONValue] | dict[str, _JSONValue] | None |
| 31 | +) |
| 32 | + |
29 | 33 | _ResponseType = tuple[int, dict[str, str], str | bytes] |
30 | 34 |
|
31 | 35 |
|
@@ -806,21 +810,21 @@ def delete_oauth2_client_credential( |
806 | 810 |
|
807 | 811 |
|
808 | 812 | @beartype |
809 | | -def _is_json_object(value: object, /) -> TypeGuard[dict[str, object]]: |
| 813 | +def _is_json_object(value: object, /) -> TypeGuard[dict[str, _JSONValue]]: |
810 | 814 | """Return whether a decoded JSON value is an object.""" |
811 | | - return TypeHint(hint=dict[str, object]).is_bearable(obj=value) |
| 815 | + return TypeHint(hint=dict[str, _JSONValue]).is_bearable(obj=value) |
812 | 816 |
|
813 | 817 |
|
814 | 818 | @beartype |
815 | | -def _is_json_array(value: object, /) -> TypeGuard[list[object]]: |
| 819 | +def _is_json_array(value: object, /) -> TypeGuard[list[_JSONValue]]: |
816 | 820 | """Return whether a decoded JSON value is an array.""" |
817 | | - return isinstance(value, list) |
| 821 | + return TypeHint(hint=list[_JSONValue]).is_bearable(obj=value) |
818 | 822 |
|
819 | 823 |
|
820 | 824 | @beartype |
821 | 825 | def _load_request_json( |
822 | 826 | request: RequestData, |
823 | | -) -> dict[str, object] | _ResponseType: |
| 827 | +) -> dict[str, _JSONValue] | _ResponseType: |
824 | 828 | """Load a Model Target dataset creation request body.""" |
825 | 829 | content_type_header = _get_header(request=request, name="Content-Type") |
826 | 830 | content_type = ( |
|
0 commit comments