We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5a8157a + eb85f2f commit 6a4a173Copy full SHA for 6a4a173
lib/rspec_api_documentation/dsl/endpoint/params.rb
@@ -30,6 +30,16 @@ def extended
30
unless p[:value]
31
cur = extra_params
32
[*p[:scope]].each { |scope| cur = cur && (cur[scope.to_sym] || cur[scope.to_s]) }
33
+
34
+ # When the current parameter is an array of objects, we use the
35
+ # first one for the value and add a scope indicator. The
36
+ # resulting parameter name looks like +props[pictures][][id]+
37
+ # this.
38
+ if cur.is_a?(Array) && cur.first.is_a?(Hash)
39
+ cur = cur.first
40
+ param[:scope] << ''
41
+ end
42
43
p[:value] = cur && (cur[p[:name].to_s] || cur[p[:name].to_sym])
44
end
45
p
0 commit comments