File tree Expand file tree Collapse file tree 6 files changed +19
-8
lines changed Expand file tree Collapse file tree 6 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "." : " 1.14.2 "
2
+ "." : " 1.15.0 "
3
3
}
Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## 1.15.0 (2025-07-31)
4
+
5
+ Full Changelog: [ v1.14.2...v1.15.0] ( https://github.com/OneBusAway/python-sdk/compare/v1.14.2...v1.15.0 )
6
+
7
+ ### Features
8
+
9
+ * ** client:** support file upload requests ([ 27cab18] ( https://github.com/OneBusAway/python-sdk/commit/27cab1813ce2774ca1a88856190898d28b303c00 ) )
10
+
3
11
## 1.14.2 (2025-07-25)
4
12
5
13
Full Changelog: [ v1.14.1...v1.14.2] ( https://github.com/OneBusAway/python-sdk/compare/v1.14.1...v1.14.2 )
Original file line number Diff line number Diff line change 1
1
[project ]
2
2
name = " onebusaway"
3
- version = " 1.14.2 "
3
+ version = " 1.15.0 "
4
4
description = " The official Python library for the onebusaway-sdk API"
5
5
dynamic = [" readme" ]
6
6
license = " Apache-2.0"
Original file line number Diff line number Diff line change @@ -532,7 +532,10 @@ def _build_request(
532
532
is_body_allowed = options .method .lower () != "get"
533
533
534
534
if is_body_allowed :
535
- kwargs ["json" ] = json_data if is_given (json_data ) else None
535
+ if isinstance (json_data , bytes ):
536
+ kwargs ["content" ] = json_data
537
+ else :
538
+ kwargs ["json" ] = json_data if is_given (json_data ) else None
536
539
kwargs ["files" ] = files
537
540
else :
538
541
headers .pop ("Content-Type" , None )
Original file line number Diff line number Diff line change @@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes:
69
69
return file
70
70
71
71
if is_tuple_t (file ):
72
- return (file [0 ], _read_file_content (file [1 ]), * file [2 :])
72
+ return (file [0 ], read_file_content (file [1 ]), * file [2 :])
73
73
74
74
raise TypeError (f"Expected file types input to be a FileContent type or to be a tuple" )
75
75
76
76
77
- def _read_file_content (file : FileContent ) -> HttpxFileContent :
77
+ def read_file_content (file : FileContent ) -> HttpxFileContent :
78
78
if isinstance (file , os .PathLike ):
79
79
return pathlib .Path (file ).read_bytes ()
80
80
return file
@@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes:
111
111
return file
112
112
113
113
if is_tuple_t (file ):
114
- return (file [0 ], await _async_read_file_content (file [1 ]), * file [2 :])
114
+ return (file [0 ], await async_read_file_content (file [1 ]), * file [2 :])
115
115
116
116
raise TypeError (f"Expected file types input to be a FileContent type or to be a tuple" )
117
117
118
118
119
- async def _async_read_file_content (file : FileContent ) -> HttpxFileContent :
119
+ async def async_read_file_content (file : FileContent ) -> HttpxFileContent :
120
120
if isinstance (file , os .PathLike ):
121
121
return await anyio .Path (file ).read_bytes ()
122
122
Original file line number Diff line number Diff line change 1
1
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
3
3
__title__ = "onebusaway"
4
- __version__ = "1.14.2 " # x-release-please-version
4
+ __version__ = "1.15.0 " # x-release-please-version
You can’t perform that action at this time.
0 commit comments