Skip to content

Commit

Permalink
Slate required check failed because of a MarkdownExample update
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
oestrich committed Jun 23, 2016
1 parent 5912e94 commit d8570ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/rspec_api_documentation/views/markdown_example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ def initialize(example, configuration)
end

def parameters
super.each do |parameter|
parameter[:required] = parameter[:required] ? 'true' : 'false'
super.map do |parameter|
parameter.merge({
:required => parameter[:required] ? 'true' : 'false',
})
end
end

Expand Down
8 changes: 8 additions & 0 deletions lib/rspec_api_documentation/views/slate_example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ def initialize(example, configuration)
super
self.template_name = "rspec_api_documentation/slate_example"
end

def parameters
super.map do |parameter|
parameter.merge({
:required => parameter[:required] == 'true' ? true : false,
})
end
end
end
end
end

0 comments on commit d8570ef

Please sign in to comment.