mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 15:22:56 +00:00
add oauth flow renaming and warnings
This commit is contained in:
@@ -197,6 +197,14 @@ module Rswag
|
||||
|
||||
ActiveSupport::Deprecation.warn("Rswag::Specs: WARNING: securityDefinitions flow is replaced in OpenAPI3! Rename to components/securitySchemes/#{name}/flows[] (in swagger_helper.rb)")
|
||||
flow = swagger_doc[:components][:securitySchemes][name].delete(:flow)
|
||||
if flow == :accessCode
|
||||
ActiveSupport::Deprecation.warn("Rswag::Specs: WARNING: securityDefinitions accessCode is replaced in OpenAPI3! Rename to clientCredentials (in swagger_helper.rb)")
|
||||
flow = :clientCredentials
|
||||
end
|
||||
if flow == :application
|
||||
ActiveSupport::Deprecation.warn("Rswag::Specs: WARNING: securityDefinitions application is replaced in OpenAPI3! Rename to authorizationCode (in swagger_helper.rb)")
|
||||
flow = :authorizationCode
|
||||
end
|
||||
flow_elements = swagger_doc[:components][:securitySchemes][name].except(:type).each_with_object({}) do |(k, _v), a|
|
||||
a[k] = swagger_doc[:components][:securitySchemes][name].delete(k)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user