forked from loafle/openapi-generator-original
Merge pull request #584 from wing328/ruby_fix_accept
Fixed Ruby header: "Accept", "Content-Type"
This commit is contained in:
@@ -41,8 +41,16 @@ class {{classname}}
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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}}}'] = {{{paramName}}}{{/optional}}{{/headerParams}}
|
||||
# http body (model)
|
||||
|
||||
@@ -32,8 +32,16 @@ class PetApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
@@ -92,8 +100,16 @@ class PetApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
@@ -152,8 +168,16 @@ class PetApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
@@ -194,8 +218,16 @@ class PetApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
@@ -237,8 +269,16 @@ class PetApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
@@ -283,8 +323,16 @@ class PetApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
@@ -328,8 +376,16 @@ class PetApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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
|
||||
# http body (model)
|
||||
@@ -373,8 +429,16 @@ class PetApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
|
||||
@@ -30,8 +30,16 @@ class StoreApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
@@ -72,8 +80,16 @@ class StoreApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
@@ -134,8 +150,16 @@ class StoreApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
@@ -176,8 +200,16 @@ class StoreApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
|
||||
@@ -32,8 +32,16 @@ class UserApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
@@ -92,8 +100,16 @@ class UserApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
@@ -152,8 +168,16 @@ class UserApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
@@ -214,8 +238,16 @@ class UserApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
@@ -253,8 +285,16 @@ class UserApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
@@ -294,8 +334,16 @@ class UserApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
@@ -338,8 +386,16 @@ class UserApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
@@ -399,8 +455,16 @@ class UserApi
|
||||
query_param_keys.include? key
|
||||
end
|
||||
|
||||
# header parameters, if any
|
||||
# header parameters
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user