-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(python,asyncio): multipart form data serialization (#19302)
* fix: object serialization for multipart requests This PR is essentially <#18140> but for the asyncio client. * fix: int serialization for multipart requests urllib3 handles serializing ints in post params (ref 1), while asyncio explicitly does not (ref 2). ref 1: <https://github.com/urllib3/urllib3/blob/9316764e90aea8d193cd8f03b0caccdf02af3ba0/src/urllib3/filepost.py#L75-L76> ref 2: <aio-libs/aiohttp#920> * test: new fake multipart endpoint with files and body * test: regression test for stringified body params * fix: mypy tweak * fix: FILES regeneration * feat: object, int serialization for multipart reqs Extends previous commits (and #18140) to cover the python-pydantic-v1 client as well. * fix: use async with in test * test: regression test for pydantic-v1-aiohttp * test: add regression test to pydantic-v1 Also brings the second test in line with the first, patching `urllib3.PoolManager.urlopen`
- Loading branch information
1 parent
0026e15
commit 8171648
Showing
48 changed files
with
2,207 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...petstore/python-aiohttp/docs/UploadFileWithAdditionalPropertiesRequestObject.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# UploadFileWithAdditionalPropertiesRequestObject | ||
|
||
Additional object | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**name** | **str** | | [optional] | ||
|
||
## Example | ||
|
||
```python | ||
from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject | ||
|
||
# TODO update the JSON string below | ||
json = "{}" | ||
# create an instance of UploadFileWithAdditionalPropertiesRequestObject from a JSON string | ||
upload_file_with_additional_properties_request_object_instance = UploadFileWithAdditionalPropertiesRequestObject.from_json(json) | ||
# print the JSON string representation of the object | ||
print(UploadFileWithAdditionalPropertiesRequestObject.to_json()) | ||
|
||
# convert the object into a dict | ||
upload_file_with_additional_properties_request_object_dict = upload_file_with_additional_properties_request_object_instance.to_dict() | ||
# create an instance of UploadFileWithAdditionalPropertiesRequestObject from a dict | ||
upload_file_with_additional_properties_request_object_from_dict = UploadFileWithAdditionalPropertiesRequestObject.from_dict(upload_file_with_additional_properties_request_object_dict) | ||
``` | ||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.