[python-experimental] generate model if type != object if enums/validations exist (#2757)

* Python-experimental adds model_utils module, refactors python api class

* Fixes python-experimental so the sample sare generated in the petstore_api folder

* FIxes python samples tests

* Updates python and python-experimental tests

* Fixes python-experimental tests

* Adds newlines back to python templates + samples

* Reverts files with newline tweaks back to master branch versions

* Fixes indentation errors in python-experimental api_client

* Removes unused files

* Python files now generated in correct folders

* Adds logging when the user tries to set generateAliasAsModel in python-experimental

* Fixes typo
This commit is contained in:
Justin Black
2019-09-24 03:44:28 -07:00
committed by William Cheng
parent 002da8d9f9
commit 252c3e58be
106 changed files with 9581 additions and 7758 deletions

View File

@@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**class_name** | **str** | |
**color** | **str** | | [optional] [default to 'red']
**color** | **str** | | [optional] if omitted the server will use the default value of 'red'
[[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

@@ -3,7 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**class_name** | **str** | |
**declawed** | **bool** | | [optional]
**color** | **str** | | [optional] if omitted the server will use the default value of 'red'
[[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

@@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | | defaults to 'default-name'
**id** | **int** | | [optional]
**name** | **str** | | [default to 'default-name']
[[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

@@ -3,7 +3,9 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**class_name** | **str** | |
**breed** | **str** | | [optional]
**color** | **str** | | [optional] if omitted the server will use the default value of 'red'
[[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

@@ -3,6 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **str** | | defaults to '-efg'
[[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

@@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enum_string** | **str** | | [optional]
**enum_string_required** | **str** | |
**enum_string** | **str** | | [optional]
**enum_integer** | **int** | | [optional]
**enum_number** | **float** | | [optional]
**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional]

View File

@@ -7,6 +7,7 @@ Method | HTTP request | Description
[**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem
[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
[**fake_outer_enum_serialize**](FakeApi.md#fake_outer_enum_serialize) | **POST** /fake/outer/enum |
[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
@@ -179,8 +180,61 @@ 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)
# **fake_outer_enum_serialize**
> OuterEnum fake_outer_enum_serialize()
Test serialization of outer enum
### Example
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.rest import ApiException
from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
body = OuterEnum("placed") # OuterEnum | Input enum as post body (optional)
try:
api_response = api_instance.fake_outer_enum_serialize(body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling FakeApi->fake_outer_enum_serialize: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**OuterEnum**](str.md)| Input enum as post body | [optional]
### Return type
[**OuterEnum**](OuterEnum.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Output enum | - |
[[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)
# **fake_outer_number_serialize**
> float fake_outer_number_serialize()
> OuterNumber fake_outer_number_serialize()
@@ -197,7 +251,7 @@ from pprint import pprint
# Create an instance of the API class
api_instance = petstore_api.FakeApi()
body = 3.4 # float | Input number as post body (optional)
body = OuterNumber(3.4) # OuterNumber | Input number as post body (optional)
try:
api_response = api_instance.fake_outer_number_serialize(body=body)
@@ -210,11 +264,11 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **float**| Input number as post body | [optional]
**body** | [**OuterNumber**](float.md)| Input number as post body | [optional]
### Return type
**float**
[**OuterNumber**](OuterNumber.md)
### Authorization

View File

@@ -3,19 +3,19 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**number** | **float** | |
**byte** | **str** | |
**date** | **date** | |
**password** | **str** | |
**integer** | **int** | | [optional]
**int32** | **int** | | [optional]
**int64** | **int** | | [optional]
**number** | **float** | |
**float** | **float** | | [optional]
**double** | **float** | | [optional]
**string** | **str** | | [optional]
**byte** | **str** | |
**binary** | **file** | | [optional]
**date** | **date** | |
**date_time** | **datetime** | | [optional]
**uuid** | **str** | | [optional]
**password** | **str** | |
[[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

@@ -6,7 +6,7 @@ Name | Type | Description | Notes
**map_map_of_string** | **dict(str, dict(str, str))** | | [optional]
**map_of_enum_string** | **dict(str, str)** | | [optional]
**direct_map** | **dict(str, bool)** | | [optional]
**indirect_map** | **dict(str, bool)** | | [optional]
**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
[[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

@@ -8,7 +8,7 @@ Name | Type | Description | Notes
**quantity** | **int** | | [optional]
**ship_date** | **datetime** | | [optional]
**status** | **str** | Order Status | [optional]
**complete** | **bool** | | [optional] [default to False]
**complete** | **bool** | | [optional] if omitted the server will use the default value of False
[[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

@@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**my_number** | **float** | | [optional]
**my_number** | [**OuterNumber**](OuterNumber.md) | | [optional]
**my_string** | **str** | | [optional]
**my_boolean** | **bool** | | [optional]

View File

@@ -3,6 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **str** | |
[[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 @@
# OuterNumber
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **float** | |
[[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

@@ -3,10 +3,10 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
**name** | **str** | |
**photo_urls** | **list[str]** | |
**id** | **int** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
**tags** | [**list[Tag]**](Tag.md) | | [optional]
**status** | **str** | pet status in the store | [optional]

View File

@@ -0,0 +1,9 @@
# StringBooleanMap
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[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

@@ -3,13 +3,13 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**string_item** | **str** | | [default to 'what']
**number_item** | **float** | | [default to 1.234]
**integer_item** | **int** | | [default to -2]
**bool_item** | **bool** | | [default to True]
**array_item** | **list[int]** | |
**string_item** | **str** | | defaults to 'what'
**number_item** | **float** | | defaults to 1.234
**integer_item** | **int** | | defaults to -2
**bool_item** | **bool** | | defaults to True
**date_item** | **date** | | [optional]
**datetime_item** | **datetime** | | [optional]
**array_item** | **list[int]** | |
[[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

@@ -3,11 +3,11 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**string_item** | **str** | | [default to 'what']
**number_item** | **float** | | [default to 1.234]
**integer_item** | **int** | | [default to -2]
**bool_item** | **bool** | |
**array_item** | **list[int]** | |
**string_item** | **str** | | defaults to 'what'
**number_item** | **float** | | defaults to 1.234
**integer_item** | **int** | | defaults to -2
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)