mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 07:16:40 +00:00
fix oauth corrections correct way round
This commit is contained in:
@@ -196,14 +196,14 @@ module Rswag
|
|||||||
next unless v.key?(:flow)
|
next unless v.key?(:flow)
|
||||||
|
|
||||||
ActiveSupport::Deprecation.warn("Rswag::Specs: WARNING: securityDefinitions flow is replaced in OpenAPI3! Rename to components/securitySchemes/#{name}/flows[] (in swagger_helper.rb)")
|
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)
|
flow = swagger_doc[:components][:securitySchemes][name].delete(:flow).to_s
|
||||||
if flow == :accessCode
|
if flow == 'accessCode'
|
||||||
ActiveSupport::Deprecation.warn("Rswag::Specs: WARNING: securityDefinitions accessCode is replaced in OpenAPI3! Rename to clientCredentials (in swagger_helper.rb)")
|
ActiveSupport::Deprecation.warn("Rswag::Specs: WARNING: securityDefinitions accessCode is replaced in OpenAPI3! Rename to clientCredentials (in swagger_helper.rb)")
|
||||||
flow = :clientCredentials
|
flow = 'authorizationCode'
|
||||||
end
|
end
|
||||||
if flow == :application
|
if flow == 'application'
|
||||||
ActiveSupport::Deprecation.warn("Rswag::Specs: WARNING: securityDefinitions application is replaced in OpenAPI3! Rename to authorizationCode (in swagger_helper.rb)")
|
ActiveSupport::Deprecation.warn("Rswag::Specs: WARNING: securityDefinitions application is replaced in OpenAPI3! Rename to authorizationCode (in swagger_helper.rb)")
|
||||||
flow = :authorizationCode
|
flow = 'clientCredentials'
|
||||||
end
|
end
|
||||||
flow_elements = swagger_doc[:components][:securitySchemes][name].except(:type).each_with_object({}) do |(k, _v), a|
|
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)
|
a[k] = swagger_doc[:components][:securitySchemes][name].delete(k)
|
||||||
|
|||||||
@@ -80,12 +80,12 @@ module Rswag
|
|||||||
securitySchemes: {
|
securitySchemes: {
|
||||||
myClientCredentials: {
|
myClientCredentials: {
|
||||||
type: :oauth2,
|
type: :oauth2,
|
||||||
flow: :accessCode,
|
flow: :application,
|
||||||
token_url: :somewhere
|
token_url: :somewhere
|
||||||
},
|
},
|
||||||
myAuthorizationCode: {
|
myAuthorizationCode: {
|
||||||
type: :oauth2,
|
type: :oauth2,
|
||||||
flow: :application,
|
flow: :accessCode,
|
||||||
token_url: :somewhere
|
token_url: :somewhere
|
||||||
},
|
},
|
||||||
myImplicit: {
|
myImplicit: {
|
||||||
@@ -142,7 +142,7 @@ module Rswag
|
|||||||
myClientCredentials: {
|
myClientCredentials: {
|
||||||
type: :oauth2,
|
type: :oauth2,
|
||||||
flows: {
|
flows: {
|
||||||
clientCredentials: {
|
'clientCredentials' => {
|
||||||
token_url: :somewhere
|
token_url: :somewhere
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,7 +150,7 @@ module Rswag
|
|||||||
myAuthorizationCode: {
|
myAuthorizationCode: {
|
||||||
type: :oauth2,
|
type: :oauth2,
|
||||||
flows: {
|
flows: {
|
||||||
authorizationCode: {
|
'authorizationCode' => {
|
||||||
token_url: :somewhere
|
token_url: :somewhere
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -158,7 +158,7 @@ module Rswag
|
|||||||
myImplicit: {
|
myImplicit: {
|
||||||
type: :oauth2,
|
type: :oauth2,
|
||||||
flows: {
|
flows: {
|
||||||
implicit: {
|
'implicit' => {
|
||||||
token_url: :somewhere
|
token_url: :somewhere
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user