mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-20 04:57:11 +00:00
Preserve order of securitySchemes (#14536)
* Remove alphabetical sort * Update integration testing expectations * Regenerate files
This commit is contained in:
@@ -2430,6 +2430,19 @@ toOuterEnum = \case
|
||||
|
||||
-- * Auth Methods
|
||||
|
||||
-- ** AuthOAuthPetstoreAuth
|
||||
data AuthOAuthPetstoreAuth =
|
||||
AuthOAuthPetstoreAuth Text -- ^ secret
|
||||
deriving (P.Eq, P.Show, P.Typeable)
|
||||
|
||||
instance AuthMethod AuthOAuthPetstoreAuth where
|
||||
applyAuthMethod _ a@(AuthOAuthPetstoreAuth secret) req =
|
||||
P.pure $
|
||||
if (P.typeOf a `P.elem` rAuthTypes req)
|
||||
then req `setHeader` toHeader ("Authorization", "Bearer " <> secret)
|
||||
& L.over rAuthTypesL (P.filter (/= P.typeOf a))
|
||||
else req
|
||||
|
||||
-- ** AuthApiKeyApiKey
|
||||
data AuthApiKeyApiKey =
|
||||
AuthApiKeyApiKey Text -- ^ secret
|
||||
@@ -2470,17 +2483,4 @@ instance AuthMethod AuthBasicHttpBasicTest where
|
||||
else req
|
||||
where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ])
|
||||
|
||||
-- ** AuthOAuthPetstoreAuth
|
||||
data AuthOAuthPetstoreAuth =
|
||||
AuthOAuthPetstoreAuth Text -- ^ secret
|
||||
deriving (P.Eq, P.Show, P.Typeable)
|
||||
|
||||
instance AuthMethod AuthOAuthPetstoreAuth where
|
||||
applyAuthMethod _ a@(AuthOAuthPetstoreAuth secret) req =
|
||||
P.pure $
|
||||
if (P.typeOf a `P.elem` rAuthTypes req)
|
||||
then req `setHeader` toHeader ("Authorization", "Bearer " <> secret)
|
||||
& L.over rAuthTypesL (P.filter (/= P.typeOf a))
|
||||
else req
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user