mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-19 07:37:10 +00:00
Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0
This commit is contained in:
@@ -34,6 +34,16 @@ class ApiClient(object):
|
|||||||
self.host = host
|
self.host = host
|
||||||
self.cookie = None
|
self.cookie = None
|
||||||
self.boundary = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(30))
|
self.boundary = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(30))
|
||||||
|
# Set default User-Agent.
|
||||||
|
self.user_agent = 'Python-Swagger'
|
||||||
|
|
||||||
|
@property
|
||||||
|
def user_agent(self):
|
||||||
|
return self.defaultHeaders['User-Agent']
|
||||||
|
|
||||||
|
@user_agent.setter
|
||||||
|
def user_agent(self, value):
|
||||||
|
self.defaultHeaders['User-Agent'] = value
|
||||||
|
|
||||||
def setDefaultHeader(self, headerName, headerValue):
|
def setDefaultHeader(self, headerName, headerValue):
|
||||||
self.defaultHeaders[headerName] = headerValue
|
self.defaultHeaders[headerName] = headerValue
|
||||||
|
|||||||
@@ -41,8 +41,16 @@ class {{classname}}
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = '{{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = [{{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
{{#headerParams}}{{#optional}}headers[:'{{{baseName}}}'] = options[:'{{{paramName}}}'] if options[:'{{{paramName}}}']{{/optional}}{{/headerParams}}
|
{{#headerParams}}{{#optional}}headers[:'{{{baseName}}}'] = options[:'{{{paramName}}}'] if options[:'{{{paramName}}}']{{/optional}}{{/headerParams}}
|
||||||
{{#headerParams}}{{^optional}}headers[:'{{{baseName}}}'] = {{{paramName}}}{{/optional}}{{/headerParams}}
|
{{#headerParams}}{{^optional}}headers[:'{{{baseName}}}'] = {{{paramName}}}{{/optional}}{{/headerParams}}
|
||||||
# http body (model)
|
# http body (model)
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class PetApi(object):
|
|||||||
bodyParam = None
|
bodyParam = None
|
||||||
|
|
||||||
headerParams['Accept'] = 'application/json,application/xml'
|
headerParams['Accept'] = 'application/json,application/xml'
|
||||||
headerParams['Content-Type'] = 'application/json,application/xml'
|
headerParams['Content-Type'] = 'application/json,application/xml,'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ class PetApi(object):
|
|||||||
bodyParam = None
|
bodyParam = None
|
||||||
|
|
||||||
headerParams['Accept'] = 'application/json,application/xml'
|
headerParams['Accept'] = 'application/json,application/xml'
|
||||||
headerParams['Content-Type'] = 'application/json,application/xml'
|
headerParams['Content-Type'] = 'application/json,application/xml,'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -370,7 +370,7 @@ class PetApi(object):
|
|||||||
bodyParam = None
|
bodyParam = None
|
||||||
|
|
||||||
headerParams['Accept'] = 'application/json,application/xml'
|
headerParams['Accept'] = 'application/json,application/xml'
|
||||||
headerParams['Content-Type'] = 'application/x-www-form-urlencoded'
|
headerParams['Content-Type'] = 'application/x-www-form-urlencoded,'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -506,7 +506,7 @@ class PetApi(object):
|
|||||||
bodyParam = None
|
bodyParam = None
|
||||||
|
|
||||||
headerParams['Accept'] = 'application/json,application/xml'
|
headerParams['Accept'] = 'application/json,application/xml'
|
||||||
headerParams['Content-Type'] = 'multipart/form-data'
|
headerParams['Content-Type'] = 'multipart/form-data,'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,16 @@ class ApiClient(object):
|
|||||||
self.host = host
|
self.host = host
|
||||||
self.cookie = None
|
self.cookie = None
|
||||||
self.boundary = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(30))
|
self.boundary = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(30))
|
||||||
|
# Set default User-Agent.
|
||||||
|
self.user_agent = 'Python-Swagger'
|
||||||
|
|
||||||
|
@property
|
||||||
|
def user_agent(self):
|
||||||
|
return self.defaultHeaders['User-Agent']
|
||||||
|
|
||||||
|
@user_agent.setter
|
||||||
|
def user_agent(self, value):
|
||||||
|
self.defaultHeaders['User-Agent'] = value
|
||||||
|
|
||||||
def setDefaultHeader(self, headerName, headerValue):
|
def setDefaultHeader(self, headerName, headerValue):
|
||||||
self.defaultHeaders[headerName] = headerValue
|
self.defaultHeaders[headerName] = headerValue
|
||||||
|
|||||||
@@ -32,8 +32,16 @@ class PetApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = ['application/json', 'application/xml', ]
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -92,8 +100,16 @@ class PetApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = ['application/json', 'application/xml', ]
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -152,8 +168,16 @@ class PetApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = []
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -194,8 +218,16 @@ class PetApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = []
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -237,8 +269,16 @@ class PetApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = []
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -283,8 +323,16 @@ class PetApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = ['application/x-www-form-urlencoded', ]
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -328,8 +376,16 @@ class PetApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = []
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
headers[:'api_key'] = api_key
|
headers[:'api_key'] = api_key
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -373,8 +429,16 @@ class PetApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = ['multipart/form-data', ]
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
|
|||||||
@@ -30,8 +30,16 @@ class StoreApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = []
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -72,8 +80,16 @@ class StoreApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = []
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -134,8 +150,16 @@ class StoreApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = []
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -176,8 +200,16 @@ class StoreApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = []
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
|
|||||||
@@ -32,8 +32,16 @@ class UserApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = []
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -92,8 +100,16 @@ class UserApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = []
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -152,8 +168,16 @@ class UserApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = []
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -214,8 +238,16 @@ class UserApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = []
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -253,8 +285,16 @@ class UserApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = []
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -294,8 +334,16 @@ class UserApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = []
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -338,8 +386,16 @@ class UserApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = []
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
@@ -399,8 +455,16 @@ class UserApi
|
|||||||
query_param_keys.include? key
|
query_param_keys.include? key
|
||||||
end
|
end
|
||||||
|
|
||||||
# header parameters, if any
|
# header parameters
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
|
_header_accept = 'application/json, application/xml'
|
||||||
|
if _header_accept != ''
|
||||||
|
headerParams['Accept'] = _header_accept
|
||||||
|
end
|
||||||
|
_header_content_type = []
|
||||||
|
headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
|
|||||||
Reference in New Issue
Block a user