Skip to content

Commit ac48889

Browse files
committed
add the swagger_endpoint_guard to both documentation endpoints
1 parent c7c93b6 commit ac48889

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/grape-swagger/doc_methods.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ def setup(options)
4545

4646
desc api_doc.delete(:desc), api_doc
4747

48-
instance_eval(guard) unless guard.nil?
49-
5048
output_path_definitions = proc do |combi_routes, endpoint|
5149
output = endpoint.swagger_object(
5250
target_class,
@@ -64,6 +62,8 @@ def setup(options)
6462
output
6563
end
6664

65+
instance_eval(guard) unless guard.nil?
66+
6767
get mount_path do
6868
header['Access-Control-Allow-Origin'] = '*'
6969
header['Access-Control-Request-Method'] = '*'
@@ -79,6 +79,8 @@ def setup(options)
7979
optional :locale, type: Symbol, desc: 'Locale of API documentation'
8080
end
8181

82+
instance_eval(guard) unless guard.nil?
83+
8284
get "#{mount_path}/:name" do
8385
I18n.locale = params[:locale] || I18n.default_locale
8486

0 commit comments

Comments
 (0)