Skip to content

Commit 8dccfa3

Browse files
Jibbarthsoyuka
authored andcommitted
Update oauth description with used flow
1 parent d376566 commit 8dccfa3

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/Swagger/Serializer/DocumentationNormalizer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,10 @@ private function computeDoc(bool $v3, Documentation $documentation, \ArrayObject
639639

640640
$securityDefinitions['oauth'] = [
641641
'type' => $this->oauthType,
642-
'description' => 'OAuth client_credentials Grant',
642+
'description' => sprintf(
643+
'OAuth 2.0 %s Grant',
644+
strtolower(preg_replace('/[A-Z]/', ' \\0', lcfirst($this->oauthFlow)))
645+
),
643646
];
644647

645648
if ($v3) {

tests/Swagger/Serializer/DocumentationNormalizerV2Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ interface_exists(AdvancedNameConverterInterface::class)
492492
'securityDefinitions' => [
493493
'oauth' => [
494494
'type' => 'oauth2',
495-
'description' => 'OAuth client_credentials Grant',
495+
'description' => 'OAuth 2.0 application Grant',
496496
'flow' => 'application',
497497
'tokenUrl' => '/oauth/v2/token',
498498
'authorizationUrl' => '/oauth/v2/auth',

tests/Swagger/Serializer/DocumentationNormalizerV3Test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ private function doTestNormalizeWithNameConverter(bool $legacy = false): void
483483
$legacy ? $nameConverter : null,
484484
true,
485485
'oauth2',
486-
'application',
486+
'authorizationCode',
487487
'/oauth/v2/token',
488488
'/oauth/v2/auth',
489489
['scope param'],
@@ -554,9 +554,9 @@ private function doTestNormalizeWithNameConverter(bool $legacy = false): void
554554
'securitySchemes' => [
555555
'oauth' => [
556556
'type' => 'oauth2',
557-
'description' => 'OAuth client_credentials Grant',
557+
'description' => 'OAuth 2.0 authorization code Grant',
558558
'flows' => [
559-
'application' => [
559+
'authorizationCode' => [
560560
'tokenUrl' => '/oauth/v2/token',
561561
'authorizationUrl' => '/oauth/v2/auth',
562562
'scopes' => ['scope param'],

0 commit comments

Comments
 (0)