From 82d3199cf0dfebdbad824e947740bdee2d6dd498 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 21 Dec 2023 16:23:27 +1100 Subject: [PATCH] Update Swagger config to new naming Avoids deprecation warnings: ``` DEPRECATION WARNING: swagger_root= is deprecated and will be removed from rswag-api 3.0 (use openapi_root= instead) (called from block in
at config/initializers/rswag_api.rb:8) DEPRECATION WARNING: Rswag::Ui: WARNING: The method will be renamed to "openapi_endpoint" in v3.0 (called from block in
at config/initializers/rswag_ui.rb:12) DEPRECATION WARNING: Rswag::Ui: WARNING: The method will be renamed to "openapi_endpoint" in v3.0 (called from block in
at config/initializers/rswag_ui.rb:13) ``` --- config/initializers/rswag_api.rb | 2 +- config/initializers/rswag_ui.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/initializers/rswag_api.rb b/config/initializers/rswag_api.rb index 15e2107512..59911cef65 100644 --- a/config/initializers/rswag_api.rb +++ b/config/initializers/rswag_api.rb @@ -5,7 +5,7 @@ Rswag::Api.configure do |config| # This is used by the Swagger middleware to serve requests for API descriptions # NOTE: If you're using rswag-specs to generate Swagger, you'll need to ensure # that it's configured to generate files in the same folder - config.swagger_root = Rails.root.join("swagger").to_s + config.openapi_root = Rails.root.join("swagger").to_s # Inject a lamda function to alter the returned Swagger prior to serialization # The function will have access to the rack env for the current request diff --git a/config/initializers/rswag_ui.rb b/config/initializers/rswag_ui.rb index bcb7c95cbe..81ab58c1b9 100644 --- a/config/initializers/rswag_ui.rb +++ b/config/initializers/rswag_ui.rb @@ -9,8 +9,8 @@ Rswag::Ui.configure do |config| # (under swagger_root) as JSON or YAML endpoints, then the list below should # correspond to the relative paths for those endpoints. - config.swagger_endpoint 'v1.yaml', 'API V1 Docs' - config.swagger_endpoint 'dfc.yaml', 'OFN DFC API Docs' + config.openapi_endpoint 'v1.yaml', 'API V1 Docs' + config.openapi_endpoint 'dfc.yaml', 'OFN DFC API Docs' # Add Basic Auth in case your API is private # config.basic_auth_enabled = true