forked from loafle/openapi-generator-original
Merge branch 'develop_2.0' of github.com:swagger-api/swagger-codegen into develop_2.0
This commit is contained in:
commit
2cc9b10a1e
@ -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,9 +32,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -92,9 +100,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -152,9 +168,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -194,9 +218,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -237,9 +269,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -283,9 +323,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -328,9 +376,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -373,9 +429,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
@ -30,9 +30,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -72,9 +80,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -134,9 +150,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -176,9 +200,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
@ -32,9 +32,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -92,9 +100,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -152,9 +168,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -214,9 +238,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -253,9 +285,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -294,9 +334,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -338,9 +386,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
@ -399,9 +455,17 @@ 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)
|
||||||
post_body = nil
|
post_body = nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user