@@ -105,7 +105,6 @@ def path_item(routes, options)
105
105
def method_object ( route , options , path )
106
106
method = { }
107
107
method [ :description ] = description_object ( route , options [ :markdown ] )
108
- method [ :headers ] = route . route_headers if route . route_headers
109
108
method [ :produces ] = produces_object ( route , options [ :produces ] || options [ :format ] )
110
109
method [ :consumes ] = consumes_object ( route , options [ :format ] )
111
110
method [ :parameters ] = params_object ( route )
@@ -194,14 +193,13 @@ def tag_object(route, version)
194
193
def partition_params ( route )
195
194
declared_params = route . route_settings [ :declared_params ] if route . route_settings [ :declared_params ] . present?
196
195
required , exposed = route . route_params . partition { |x | x . first . is_a? String }
197
-
196
+ required . concat GrapeSwagger :: DocMethods :: Headers . parse ( route ) unless route . route_headers . nil?
198
197
default_type ( required )
199
198
default_type ( exposed )
200
199
201
- unless declared_params . nil?
200
+ unless declared_params . nil? && route . route_headers . nil?
202
201
request_params = parse_request_params ( required )
203
202
end
204
-
205
203
if !exposed . empty?
206
204
exposed_params = exposed . each_with_object ( { } ) { |x , memo | memo [ x . first ] = x . last }
207
205
properties = parse_response_params ( exposed_params )
@@ -215,8 +213,7 @@ def partition_params(route)
215
213
@definitions [ key ] = { type : 'object' , properties : properties } unless @definitions . key? ( key )
216
214
@definitions [ key ] [ :properties ] . merge! ( properties ) if @definitions . key? ( key )
217
215
end
218
-
219
- return route . route_params if route . route_params && !route . route_settings [ :declared_params ] . present?
216
+ return route . route_params if route . route_params . present? && !route . route_settings [ :declared_params ] . present?
220
217
request_params || { }
221
218
end
222
219
@@ -244,6 +241,7 @@ def parse_response_params(params)
244
241
return if params . nil?
245
242
246
243
params . each_with_object ( { } ) do |x , memo |
244
+ next if x [ 1 ] . fetch ( :documentation , { } ) . fetch ( :in , nil ) . to_s == 'header'
247
245
x [ 0 ] = x . last [ :as ] if x . last [ :as ]
248
246
249
247
model = x . last [ :using ] if x . last [ :using ] . present?
0 commit comments