Skip to content

Commit d8570ef

Browse files
committed
Slate required check failed because of a MarkdownExample update
Instead of displaying `*required*` a recent PR started showing a required column that displayed true/false. This broke the slate display which is text. Instead of altering the parameters hash return a new one that the slate example can revert.
1 parent 5912e94 commit d8570ef

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

lib/rspec_api_documentation/views/markdown_example.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ def initialize(example, configuration)
99
end
1010

1111
def parameters
12-
super.each do |parameter|
13-
parameter[:required] = parameter[:required] ? 'true' : 'false'
12+
super.map do |parameter|
13+
parameter.merge({
14+
:required => parameter[:required] ? 'true' : 'false',
15+
})
1416
end
1517
end
1618

lib/rspec_api_documentation/views/slate_example.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ def initialize(example, configuration)
55
super
66
self.template_name = "rspec_api_documentation/slate_example"
77
end
8+
9+
def parameters
10+
super.map do |parameter|
11+
parameter.merge({
12+
:required => parameter[:required] == 'true' ? true : false,
13+
})
14+
end
15+
end
816
end
917
end
1018
end

0 commit comments

Comments
 (0)