mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 08:46:55 +00:00
[python-client] Modify python templates to resolve linting errors (#6839)
The linting results for the generated samples are as follows where the first number is the BEFORE and the second is AFTER. pyclient 7714 vs. 120 pyclient3 7717 vs. 120 pyclient3-asyncio 7584 vs. 120 pyclient-tornado 7633 vs. 120 pyclient3-tornado 7633 vs. 120 For the complete details please see the following gist. https://gist.github.com/kenjones-cisco/2eb69a7e8db75e9fd53789f01570d9f2 Enforces linting for python clients by running flake8 for the generated python client.
This commit is contained in:
@@ -21,7 +21,7 @@ Create user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
@@ -33,7 +33,7 @@ from pprint import pprint
|
||||
api_instance = petstore_api.UserApi()
|
||||
body = petstore_api.User() # User | Created user object
|
||||
|
||||
try:
|
||||
try:
|
||||
# Create user
|
||||
api_instance.create_user(body)
|
||||
except ApiException as e:
|
||||
@@ -68,7 +68,7 @@ Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
@@ -80,7 +80,7 @@ from pprint import pprint
|
||||
api_instance = petstore_api.UserApi()
|
||||
body = [petstore_api.User()] # list[User] | List of user object
|
||||
|
||||
try:
|
||||
try:
|
||||
# Creates list of users with given input array
|
||||
api_instance.create_users_with_array_input(body)
|
||||
except ApiException as e:
|
||||
@@ -115,7 +115,7 @@ Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
@@ -127,7 +127,7 @@ from pprint import pprint
|
||||
api_instance = petstore_api.UserApi()
|
||||
body = [petstore_api.User()] # list[User] | List of user object
|
||||
|
||||
try:
|
||||
try:
|
||||
# Creates list of users with given input array
|
||||
api_instance.create_users_with_list_input(body)
|
||||
except ApiException as e:
|
||||
@@ -162,7 +162,7 @@ Delete user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
@@ -174,7 +174,7 @@ from pprint import pprint
|
||||
api_instance = petstore_api.UserApi()
|
||||
username = 'username_example' # str | The name that needs to be deleted
|
||||
|
||||
try:
|
||||
try:
|
||||
# Delete user
|
||||
api_instance.delete_user(username)
|
||||
except ApiException as e:
|
||||
@@ -209,7 +209,7 @@ Get user by user name
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
@@ -221,7 +221,7 @@ from pprint import pprint
|
||||
api_instance = petstore_api.UserApi()
|
||||
username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing.
|
||||
|
||||
try:
|
||||
try:
|
||||
# Get user by user name
|
||||
api_response = api_instance.get_user_by_name(username)
|
||||
pprint(api_response)
|
||||
@@ -257,7 +257,7 @@ Logs user into the system
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
@@ -270,7 +270,7 @@ api_instance = petstore_api.UserApi()
|
||||
username = 'username_example' # str | The user name for login
|
||||
password = 'password_example' # str | The password for login in clear text
|
||||
|
||||
try:
|
||||
try:
|
||||
# Logs user into the system
|
||||
api_response = api_instance.login_user(username, password)
|
||||
pprint(api_response)
|
||||
@@ -307,7 +307,7 @@ Logs out current logged in user session
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
@@ -318,7 +318,7 @@ from pprint import pprint
|
||||
# create an instance of the API class
|
||||
api_instance = petstore_api.UserApi()
|
||||
|
||||
try:
|
||||
try:
|
||||
# Logs out current logged in user session
|
||||
api_instance.logout_user()
|
||||
except ApiException as e:
|
||||
@@ -350,7 +350,7 @@ Updated user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
### Example
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import time
|
||||
@@ -363,7 +363,7 @@ api_instance = petstore_api.UserApi()
|
||||
username = 'username_example' # str | name that need to be deleted
|
||||
body = petstore_api.User() # User | Updated user object
|
||||
|
||||
try:
|
||||
try:
|
||||
# Updated user
|
||||
api_instance.update_user(username, body)
|
||||
except ApiException as e:
|
||||
|
||||
Reference in New Issue
Block a user