lib/rswag/api/configuration.rb in rswag-api-2.12.0 vs lib/rswag/api/configuration.rb in rswag-api-2.13.0
- old
+ new
@@ -1,12 +1,20 @@
module Rswag
module Api
class Configuration
- attr_accessor :swagger_root, :swagger_filter, :swagger_headers
+ attr_accessor :openapi_root, :swagger_filter, :swagger_headers
- def resolve_swagger_root(env)
+ def resolve_openapi_root(env)
path_params = env['action_dispatch.request.path_parameters'] || {}
- path_params[:swagger_root] || swagger_root
+
+ if path_params.key?(:swagger_root)
+ Rswag::Api.deprecator.warn(
+ 'swagger_root is deprecated and will be removed from rswag-api 3.0 (use openapi_root instead)'
+ )
+ return path_params[:swagger_root]
+ end
+
+ path_params[:openapi_root] || openapi_root
end
end
end
end