[python-client] Add model default values (#1776)

* Adds two models to the v2.0 spec, uses examples as defaults in python client

* Adds array default and type_holder_default and type_holder_example tests

* Re-generated python security client with ./bin/security/python-petstore.sh

* Changes comment text, rebased master

* Updates client + server samples

* Adds missing samples updates

* Changes python client to look for true or false with booleans in toDefaultValue

* Changes boolean casting to use Boolean.valueOf

* Adds deserialization fix for python tests

* Changes Mock to namedtuple in python deserialization tests

* Actually remove unittest.mock
This commit is contained in:
Justin Black
2019-01-08 19:18:35 -08:00
committed by William Cheng
parent 189849319c
commit 539ec23298
197 changed files with 20872 additions and 292 deletions

View File

@@ -15,7 +15,7 @@ Method | HTTP request | Description
# **create_user**
> create_user(user)
> create_user(body)
Create user
@@ -31,11 +31,11 @@ from pprint import pprint
# create an instance of the API class
api_instance = petstore_api.UserApi()
user = petstore_api.User() # User | Created user object
body = petstore_api.User() # User | Created user object
try:
# Create user
api_instance.create_user(user)
api_instance.create_user(body)
except ApiException as e:
print("Exception when calling UserApi->create_user: %s\n" % e)
```
@@ -44,7 +44,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**User**](User.md)| Created user object |
**body** | [**User**](User.md)| Created user object |
### Return type
@@ -62,7 +62,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **create_users_with_array_input**
> create_users_with_array_input(user)
> create_users_with_array_input(body)
Creates list of users with given input array
@@ -76,11 +76,11 @@ from pprint import pprint
# create an instance of the API class
api_instance = petstore_api.UserApi()
user = NULL # list[User] | List of user object
body = NULL # list[User] | List of user object
try:
# Creates list of users with given input array
api_instance.create_users_with_array_input(user)
api_instance.create_users_with_array_input(body)
except ApiException as e:
print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e)
```
@@ -89,7 +89,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**list[User]**](list.md)| List of user object |
**body** | [**list[User]**](list.md)| List of user object |
### Return type
@@ -107,7 +107,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **create_users_with_list_input**
> create_users_with_list_input(user)
> create_users_with_list_input(body)
Creates list of users with given input array
@@ -121,11 +121,11 @@ from pprint import pprint
# create an instance of the API class
api_instance = petstore_api.UserApi()
user = NULL # list[User] | List of user object
body = NULL # list[User] | List of user object
try:
# Creates list of users with given input array
api_instance.create_users_with_list_input(user)
api_instance.create_users_with_list_input(body)
except ApiException as e:
print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e)
```
@@ -134,7 +134,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**list[User]**](list.md)| List of user object |
**body** | [**list[User]**](list.md)| List of user object |
### Return type
@@ -334,7 +334,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **update_user**
> update_user(username, user)
> update_user(username, body)
Updated user
@@ -351,11 +351,11 @@ from pprint import pprint
# create an instance of the API class
api_instance = petstore_api.UserApi()
username = 'username_example' # str | name that need to be deleted
user = petstore_api.User() # User | Updated user object
body = petstore_api.User() # User | Updated user object
try:
# Updated user
api_instance.update_user(username, user)
api_instance.update_user(username, body)
except ApiException as e:
print("Exception when calling UserApi->update_user: %s\n" % e)
```
@@ -365,7 +365,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **str**| name that need to be deleted |
**user** | [**User**](User.md)| Updated user object |
**body** | [**User**](User.md)| Updated user object |
### Return type