Skip to content

Commit

Permalink
fix: python clients (#136)
Browse files Browse the repository at this point in the history
* fix: python client

* fix: regenerate petstore samples for python-asyncio/tornado

* fix: python-asyncio tests

* fix: python-tornado tests

* chore: update python samples

* fix: enable tests for python-tornado

* fix: discriminator property

* fix: file type

* python: regenerate samples

* fix: define file as generic type
  • Loading branch information
tomplus authored and wing328 committed Apr 21, 2018
1 parent fdeca62 commit d74d2ba
Show file tree
Hide file tree
Showing 69 changed files with 1,562 additions and 1,276 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public PythonClientCodegen() {
languageSpecificPrimitives.add("datetime");
languageSpecificPrimitives.add("date");
languageSpecificPrimitives.add("object");
// TODO file and binary is mapped as `file`
languageSpecificPrimitives.add("file");

typeMapping.clear();
typeMapping.put("integer", "int");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
REQUIRES.append("aiohttp")
{{/asyncio}}
{{#tornado}}
REQUIRES.append("tornado")
REQUIRES.append("tornado>=4.2,<5")
{{/tornado}}
setup(
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@
<module>samples/client/petstore/akka-scala</module>
<module>samples/client/petstore/javascript</module>
<module>samples/client/petstore/python</module>
<!--<module>samples/client/petstore/python-tornado</module>-->
<module>samples/client/petstore/python-tornado</module>
<module>samples/client/petstore/python-asyncio</module>
<module>samples/client/petstore/typescript-fetch/builds/default</module>
<module>samples/client/petstore/typescript-fetch/builds/es6-target</module>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.0-SNAPSHOT
3.0.0-SNAPSHOT
11 changes: 6 additions & 5 deletions samples/client/petstore/python-asyncio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This Python package is automatically generated by the [Swagger Codegen](https://

- API version: 1.0.0
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.PythonClientCodegen
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.

Expand Down Expand Up @@ -52,11 +52,11 @@ from petstore_api.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = petstore_api.AnotherFakeApi()
body = petstore_api.Client() # Client | client model
client = petstore_api.Client() # Client | client model

try:
# To test special tags
api_response = api_instance.test_special_tags(body)
api_response = api_instance.test_special_tags(client)
pprint(api_response)
except ApiException as e:
print("Exception when calling AnotherFakeApi->test_special_tags: %s\n" % e)
Expand All @@ -74,6 +74,7 @@ Class | Method | HTTP request | Description
*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \&quot;client\&quot; model
*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters
Expand Down Expand Up @@ -112,9 +113,11 @@ Class | Method | HTTP request | Description
- [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [ArrayTest](docs/ArrayTest.md)
- [Capitalization](docs/Capitalization.md)
- [Cat](docs/Cat.md)
- [Category](docs/Category.md)
- [ClassModel](docs/ClassModel.md)
- [Client](docs/Client.md)
- [Dog](docs/Dog.md)
- [EnumArrays](docs/EnumArrays.md)
- [EnumClass](docs/EnumClass.md)
- [EnumTest](docs/EnumTest.md)
Expand All @@ -138,8 +141,6 @@ Class | Method | HTTP request | Description
- [SpecialModelName](docs/SpecialModelName.md)
- [Tag](docs/Tag.md)
- [User](docs/User.md)
- [Cat](docs/Cat.md)
- [Dog](docs/Dog.md)


## Documentation For Authorization
Expand Down
8 changes: 4 additions & 4 deletions samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Method | HTTP request | Description


# **test_special_tags**
> Client test_special_tags(body)
> Client test_special_tags(client)
To test special tags

Expand All @@ -24,11 +24,11 @@ from pprint import pprint

# create an instance of the API class
api_instance = petstore_api.AnotherFakeApi()
body = petstore_api.Client() # Client | client model
client = petstore_api.Client() # Client | client model

try:
# To test special tags
api_response = api_instance.test_special_tags(body)
api_response = api_instance.test_special_tags(client)
pprint(api_response)
except ApiException as e:
print("Exception when calling AnotherFakeApi->test_special_tags: %s\n" % e)
Expand All @@ -38,7 +38,7 @@ except ApiException as e:

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
**client** | [**Client**](Client.md)| client model |

### Return type

Expand Down
1 change: 1 addition & 0 deletions samples/client/petstore/python-asyncio/docs/EnumTest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enum_string** | **str** | | [optional]
**enum_string_required** | **str** | |
**enum_integer** | **int** | | [optional]
**enum_number** | **float** | | [optional]
**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional]
Expand Down
Loading

0 comments on commit d74d2ba

Please sign in to comment.