Skip to content

Commit 4ae8ed9

Browse files
committed
Rectified metadata script to generate correct paths with nested segments containing microsoft.graph prefix
1 parent 0dfd617 commit 4ae8ed9

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/Authentication/Authentication/custom/common/MgCommandMetadata.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95132,7 +95132,7 @@
9513295132
},
9513395133
{
9513495134
"Module": "Beta.Identity.SignIns",
95135-
"Uri": "/identity/authenticationEventsFlows/{authenticationEventsFlow-id}/onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders",
95135+
"Uri": "/identity/authenticationEventsFlows/{authenticationEventsFlow-id}/externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStartonAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders",
9513695136
"OutputType": "IMicrosoftGraphIdentityProviderBase",
9513795137
"Method": "GET",
9513895138
"ApiVersion": "beta",
@@ -95208,7 +95208,7 @@
9520895208
},
9520995209
{
9521095210
"Module": "Beta.Identity.SignIns",
95211-
"Uri": "/identity/authenticationEventsFlows/{authenticationEventsFlow-id}/onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/$ref",
95211+
"Uri": "/identity/authenticationEventsFlows/{authenticationEventsFlow-id}/externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStartonAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/$ref",
9521295212
"OutputType": null,
9521395213
"Method": "GET",
9521495214
"ApiVersion": "beta",
@@ -95220,7 +95220,7 @@
9522095220
},
9522195221
{
9522295222
"Module": "Beta.Identity.SignIns",
95223-
"Uri": "/identity/authenticationEventsFlows/{authenticationEventsFlow-id}/onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/$count",
95223+
"Uri": "/identity/authenticationEventsFlows/{authenticationEventsFlow-id}/externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStartonAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/$count",
9522495224
"OutputType": null,
9522595225
"Method": "GET",
9522695226
"ApiVersion": "beta",
@@ -305344,7 +305344,7 @@
305344305344
},
305345305345
{
305346305346
"Module": "Beta.Identity.SignIns",
305347-
"Uri": "/identity/authenticationEventsFlows/{authenticationEventsFlow-id}/onAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/$ref",
305347+
"Uri": "/identity/authenticationEventsFlows/{authenticationEventsFlow-id}/externalUsersSelfServiceSignUpEventsFlow/onAuthenticationMethodLoadStartonAuthenticationMethodLoadStartExternalUsersSelfServiceSignUp/identityProviders/$ref",
305348305348
"OutputType": null,
305349305349
"Method": "POST",
305350305350
"ApiVersion": "beta",

tools/PostGeneration/NewCommandMetadata.ps1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,16 @@ $ApiVersion | ForEach-Object {
6161
# Remove FQN in action/function names.
6262
if ($Uri -match $ActionFunctionFQNPattern) {
6363
$MatchedUriSegment = $Matches.0
64+
$SegmentBuilder = ""
6465
# Trim nested namespace segments.
65-
$NestedNamespaceSegments = $Matches.1 -split "\."
66-
# Remove trailing '()' from functions.
67-
$LastSegment = $NestedNamespaceSegments[-1] -replace "\(\)", ""
68-
$Uri = $Uri -replace [Regex]::Escape($MatchedUriSegment), "/$LastSegment"
66+
$NestedNamespaceSegments = $Matches.1 -split "/"
67+
# Remove microsoft.graph prefix and remove trailing '()' from functions.
68+
foreach($segment in $NestedNamespaceSegments){
69+
$segment = $segment.Replace("microsoft.graph.","").Replace("()", "")
70+
$SegmentBuilder += "/$segment"
71+
}
72+
$Uri = $Uri -replace [Regex]::Escape($MatchedUriSegment), $SegmentBuilder
6973
}
70-
7174
$MappingValue = @{
7275
Command = $CommandName
7376
Variants = [System.Collections.ArrayList]@($VariantName)

0 commit comments

Comments
 (0)