mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 05:02:46 +00:00
fix parameter name, better naming convention for python client
This commit is contained in:
@@ -31,13 +31,13 @@ class Order(object):
|
||||
'id': 'long',
|
||||
|
||||
|
||||
'petId': 'long',
|
||||
'pet_id': 'long',
|
||||
|
||||
|
||||
'quantity': 'int',
|
||||
|
||||
|
||||
'shipDate': 'DateTime',
|
||||
'ship_date': 'DateTime',
|
||||
|
||||
|
||||
'status': 'str',
|
||||
@@ -51,11 +51,11 @@ class Order(object):
|
||||
|
||||
'id': 'id',
|
||||
|
||||
'petId': 'petId',
|
||||
'pet_id': 'petId',
|
||||
|
||||
'quantity': 'quantity',
|
||||
|
||||
'shipDate': 'shipDate',
|
||||
'ship_date': 'shipDate',
|
||||
|
||||
'status': 'status',
|
||||
|
||||
@@ -68,13 +68,13 @@ class Order(object):
|
||||
self.id = None # long
|
||||
|
||||
|
||||
self.petId = None # long
|
||||
self.pet_id = None # long
|
||||
|
||||
|
||||
self.quantity = None # int
|
||||
|
||||
|
||||
self.shipDate = None # DateTime
|
||||
self.ship_date = None # DateTime
|
||||
|
||||
#Order Status
|
||||
|
||||
@@ -37,7 +37,7 @@ class Pet(object):
|
||||
'name': 'str',
|
||||
|
||||
|
||||
'photoUrls': 'list[str]',
|
||||
'photo_urls': 'list[str]',
|
||||
|
||||
|
||||
'tags': 'list[Tag]',
|
||||
@@ -55,7 +55,7 @@ class Pet(object):
|
||||
|
||||
'name': 'name',
|
||||
|
||||
'photoUrls': 'photoUrls',
|
||||
'photo_urls': 'photoUrls',
|
||||
|
||||
'tags': 'tags',
|
||||
|
||||
@@ -74,7 +74,7 @@ class Pet(object):
|
||||
self.name = None # str
|
||||
|
||||
|
||||
self.photoUrls = None # list[str]
|
||||
self.photo_urls = None # list[str]
|
||||
|
||||
|
||||
self.tags = None # list[Tag]
|
||||
@@ -34,10 +34,10 @@ class User(object):
|
||||
'username': 'str',
|
||||
|
||||
|
||||
'firstName': 'str',
|
||||
'first_name': 'str',
|
||||
|
||||
|
||||
'lastName': 'str',
|
||||
'last_name': 'str',
|
||||
|
||||
|
||||
'email': 'str',
|
||||
@@ -49,7 +49,7 @@ class User(object):
|
||||
'phone': 'str',
|
||||
|
||||
|
||||
'userStatus': 'int'
|
||||
'user_status': 'int'
|
||||
|
||||
}
|
||||
|
||||
@@ -59,9 +59,9 @@ class User(object):
|
||||
|
||||
'username': 'username',
|
||||
|
||||
'firstName': 'firstName',
|
||||
'first_name': 'firstName',
|
||||
|
||||
'lastName': 'lastName',
|
||||
'last_name': 'lastName',
|
||||
|
||||
'email': 'email',
|
||||
|
||||
@@ -69,7 +69,7 @@ class User(object):
|
||||
|
||||
'phone': 'phone',
|
||||
|
||||
'userStatus': 'userStatus'
|
||||
'user_status': 'userStatus'
|
||||
|
||||
}
|
||||
|
||||
@@ -81,10 +81,10 @@ class User(object):
|
||||
self.username = None # str
|
||||
|
||||
|
||||
self.firstName = None # str
|
||||
self.first_name = None # str
|
||||
|
||||
|
||||
self.lastName = None # str
|
||||
self.last_name = None # str
|
||||
|
||||
|
||||
self.email = None # str
|
||||
@@ -97,5 +97,5 @@ class User(object):
|
||||
|
||||
#User Status
|
||||
|
||||
self.userStatus = None # int
|
||||
self.user_status = None # int
|
||||
|
||||
@@ -272,14 +272,14 @@ class PetApi(object):
|
||||
|
||||
Args:
|
||||
|
||||
petId, long: ID of pet that needs to be fetched (required)
|
||||
pet_id, long: ID of pet that needs to be fetched (required)
|
||||
|
||||
|
||||
|
||||
Returns: Pet
|
||||
"""
|
||||
|
||||
allParams = ['petId']
|
||||
allParams = ['pet_id']
|
||||
|
||||
params = locals()
|
||||
for (key, val) in params['kwargs'].iteritems():
|
||||
@@ -306,8 +306,8 @@ class PetApi(object):
|
||||
|
||||
|
||||
|
||||
if ('petId' in params):
|
||||
replacement = str(self.apiClient.toPathValue(params['petId']))
|
||||
if ('pet_id' in params):
|
||||
replacement = str(self.apiClient.toPathValue(params['pet_id']))
|
||||
replacement = urllib.quote(replacement)
|
||||
resourcePath = resourcePath.replace('{' + 'petId' + '}',
|
||||
replacement)
|
||||
@@ -337,7 +337,7 @@ class PetApi(object):
|
||||
|
||||
Args:
|
||||
|
||||
petId, str: ID of pet that needs to be updated (required)
|
||||
pet_id, str: ID of pet that needs to be updated (required)
|
||||
|
||||
|
||||
name, str: Updated name of the pet (required)
|
||||
@@ -350,7 +350,7 @@ class PetApi(object):
|
||||
Returns:
|
||||
"""
|
||||
|
||||
allParams = ['petId', 'name', 'status']
|
||||
allParams = ['pet_id', 'name', 'status']
|
||||
|
||||
params = locals()
|
||||
for (key, val) in params['kwargs'].iteritems():
|
||||
@@ -377,8 +377,8 @@ class PetApi(object):
|
||||
|
||||
|
||||
|
||||
if ('petId' in params):
|
||||
replacement = str(self.apiClient.toPathValue(params['petId']))
|
||||
if ('pet_id' in params):
|
||||
replacement = str(self.apiClient.toPathValue(params['pet_id']))
|
||||
replacement = urllib.quote(replacement)
|
||||
resourcePath = resourcePath.replace('{' + 'petId' + '}',
|
||||
replacement)
|
||||
@@ -411,14 +411,14 @@ class PetApi(object):
|
||||
api_key, str: (required)
|
||||
|
||||
|
||||
petId, long: Pet id to delete (required)
|
||||
pet_id, long: Pet id to delete (required)
|
||||
|
||||
|
||||
|
||||
Returns:
|
||||
"""
|
||||
|
||||
allParams = ['api_key', 'petId']
|
||||
allParams = ['api_key', 'pet_id']
|
||||
|
||||
params = locals()
|
||||
for (key, val) in params['kwargs'].iteritems():
|
||||
@@ -448,8 +448,8 @@ class PetApi(object):
|
||||
|
||||
|
||||
|
||||
if ('petId' in params):
|
||||
replacement = str(self.apiClient.toPathValue(params['petId']))
|
||||
if ('pet_id' in params):
|
||||
replacement = str(self.apiClient.toPathValue(params['pet_id']))
|
||||
replacement = urllib.quote(replacement)
|
||||
resourcePath = resourcePath.replace('{' + 'petId' + '}',
|
||||
replacement)
|
||||
@@ -473,10 +473,10 @@ class PetApi(object):
|
||||
|
||||
Args:
|
||||
|
||||
petId, long: ID of pet to update (required)
|
||||
pet_id, long: ID of pet to update (required)
|
||||
|
||||
|
||||
additionalMetadata, str: Additional data to pass to server (required)
|
||||
additional_metadata, str: Additional data to pass to server (required)
|
||||
|
||||
|
||||
file, file: file to upload (required)
|
||||
@@ -486,7 +486,7 @@ class PetApi(object):
|
||||
Returns:
|
||||
"""
|
||||
|
||||
allParams = ['petId', 'additionalMetadata', 'file']
|
||||
allParams = ['pet_id', 'additional_metadata', 'file']
|
||||
|
||||
params = locals()
|
||||
for (key, val) in params['kwargs'].iteritems():
|
||||
@@ -513,16 +513,16 @@ class PetApi(object):
|
||||
|
||||
|
||||
|
||||
if ('petId' in params):
|
||||
replacement = str(self.apiClient.toPathValue(params['petId']))
|
||||
if ('pet_id' in params):
|
||||
replacement = str(self.apiClient.toPathValue(params['pet_id']))
|
||||
replacement = urllib.quote(replacement)
|
||||
resourcePath = resourcePath.replace('{' + 'petId' + '}',
|
||||
replacement)
|
||||
|
||||
|
||||
|
||||
if ('additionalMetadata' in params):
|
||||
formParams['additionalMetadata'] = params['additionalMetadata']
|
||||
if ('additional_metadata' in params):
|
||||
formParams['additionalMetadata'] = params['additional_metadata']
|
||||
|
||||
if ('file' in params):
|
||||
files['file'] = params['file']
|
||||
@@ -154,14 +154,14 @@ class StoreApi(object):
|
||||
|
||||
Args:
|
||||
|
||||
orderId, str: ID of pet that needs to be fetched (required)
|
||||
order_id, str: ID of pet that needs to be fetched (required)
|
||||
|
||||
|
||||
|
||||
Returns: Order
|
||||
"""
|
||||
|
||||
allParams = ['orderId']
|
||||
allParams = ['order_id']
|
||||
|
||||
params = locals()
|
||||
for (key, val) in params['kwargs'].iteritems():
|
||||
@@ -188,8 +188,8 @@ class StoreApi(object):
|
||||
|
||||
|
||||
|
||||
if ('orderId' in params):
|
||||
replacement = str(self.apiClient.toPathValue(params['orderId']))
|
||||
if ('order_id' in params):
|
||||
replacement = str(self.apiClient.toPathValue(params['order_id']))
|
||||
replacement = urllib.quote(replacement)
|
||||
resourcePath = resourcePath.replace('{' + 'orderId' + '}',
|
||||
replacement)
|
||||
@@ -219,14 +219,14 @@ class StoreApi(object):
|
||||
|
||||
Args:
|
||||
|
||||
orderId, str: ID of the order that needs to be deleted (required)
|
||||
order_id, str: ID of the order that needs to be deleted (required)
|
||||
|
||||
|
||||
|
||||
Returns:
|
||||
"""
|
||||
|
||||
allParams = ['orderId']
|
||||
allParams = ['order_id']
|
||||
|
||||
params = locals()
|
||||
for (key, val) in params['kwargs'].iteritems():
|
||||
@@ -253,8 +253,8 @@ class StoreApi(object):
|
||||
|
||||
|
||||
|
||||
if ('orderId' in params):
|
||||
replacement = str(self.apiClient.toPathValue(params['orderId']))
|
||||
if ('order_id' in params):
|
||||
replacement = str(self.apiClient.toPathValue(params['order_id']))
|
||||
replacement = urllib.quote(replacement)
|
||||
resourcePath = resourcePath.replace('{' + 'orderId' + '}',
|
||||
replacement)
|
||||
Reference in New Issue
Block a user