[python-experimental] adds new json content type (#13356)

* Adds json detection for application/json-patch+json

* Adds jsonPatch route and schemas

* Adds test_json_patch

* Unit test sample updated

* Reverts version files
This commit is contained in:
Justin Black
2022-09-05 09:37:01 -07:00
committed by GitHub
parent 2a8ea162d7
commit cb8d9d5bfe
34 changed files with 1580 additions and 24 deletions

View File

@@ -22,6 +22,7 @@ Method | HTTP request | Description
[**inline_additional_properties**](#inline_additional_properties) | **post** /fake/inline-additionalProperties | test inline additionalProperties
[**inline_composition**](#inline_composition) | **post** /fake/inlineComposition/ | testing composed schemas at inline locations
[**json_form_data**](#json_form_data) | **get** /fake/jsonFormData | test json serialization of form data
[**json_patch**](#json_patch) | **patch** /fake/jsonPatch | json patch
[**json_with_charset**](#json_with_charset) | **post** /fake/jsonWithCharset | json with charset tx and rx
[**mammal**](#mammal) | **post** /fake/refs/mammal |
[**number_with_validations**](#number_with_validations) | **post** /fake/refs/number |
@@ -1719,6 +1720,85 @@ body | Unset | body was not defined |
headers | Unset | headers were not defined |
void (empty response body)
### Authorization
No authorization required
[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)
# **json_patch**
<a name="json_patch"></a>
> json_patch()
json patch
json patch route with a requestBody
### Example
```python
import petstore_api
from petstore_api.apis.tags import fake_api
from petstore_api.model.json_patch_request import JSONPatchRequest
from pprint import pprint
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = petstore_api.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# Enter a context with an instance of the API client
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = fake_api.FakeApi(api_client)
# example passing only optional values
body = JSONPatchRequest([
None
])
try:
# json patch
api_response = api_instance.json_patch(
body=body,
)
except petstore_api.ApiException as e:
print("Exception when calling FakeApi->json_patch: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
body | typing.Union[SchemaForRequestBodyApplicationJsonPatchjson, Unset] | optional, default is unset |
content_type | str | optional, default is 'application/json-patch+json' | Selects the schema and serialization of the request body
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
### body
#### SchemaForRequestBodyApplicationJsonPatchjson
Type | Description | Notes
------------- | ------------- | -------------
[**JSONPatchRequest**](JSONPatchRequest.md) | |
### Return Types, Responses
Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | ApiResponseFor200 | OK
#### ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | Unset | body was not defined |
headers | Unset | headers were not defined |
void (empty response body)
### Authorization

View File

@@ -0,0 +1,8 @@
# petstore_api.model.json_patch_request.JSONPatchRequest
Type | Description | Notes
------------- | ------------- | -------------
**[bool, date, datetime, dict, float, int, list, str, none_type]** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@@ -0,0 +1,11 @@
# petstore_api.model.json_patch_request_add_replace_test.JSONPatchRequestAddReplaceTest
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**op** | **str** | The operation to perform. |
**path** | **str** | A JSON Pointer path. |
**value** | **bool, date, datetime, dict, float, int, list, str, none_type** | The value to add, replace or test. |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@@ -0,0 +1,11 @@
# petstore_api.model.json_patch_request_move_copy.JSONPatchRequestMoveCopy
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**op** | **str** | The operation to perform. |
**path** | **str** | A JSON Pointer path. |
**from** |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@@ -0,0 +1,10 @@
# petstore_api.model.json_patch_request_remove.JSONPatchRequestRemove
#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**op** | **str** | The operation to perform. |
**path** | **str** | A JSON Pointer path. |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)