diff --git a/src/Applications/beta/test/Update-MgBetaApplication.Tests.ps1 b/src/Applications/beta/test/Update-MgBetaApplication.Tests.ps1 index 7f4739c3786..e98bf765f19 100644 --- a/src/Applications/beta/test/Update-MgBetaApplication.Tests.ps1 +++ b/src/Applications/beta/test/Update-MgBetaApplication.Tests.ps1 @@ -13,7 +13,7 @@ Describe "Update-MgBetaApplication" { } It "Should support UpdateExpanded parameterSet by default" { - $UpdateMgBetaApplication.OutputType | Should -Be "System.Boolean" + $UpdateMgBetaApplication.OutputType | Should -Be "Microsoft.Graph.PowerShell.Models.IMicrosoftGraphApplication" $UpdateMgBetaApplication.DefaultParameterSet | Should -Be "UpdateExpanded" } diff --git a/src/Applications/v1.0/test/New-MgApplicationOwnerByRef.Tests.ps1 b/src/Applications/v1.0/test/New-MgApplicationOwnerByRef.Tests.ps1 index ed19136aa80..6635d07c64b 100644 --- a/src/Applications/v1.0/test/New-MgApplicationOwnerByRef.Tests.ps1 +++ b/src/Applications/v1.0/test/New-MgApplicationOwnerByRef.Tests.ps1 @@ -23,6 +23,7 @@ Describe "New-MgApplicationOwnerByRef" { $CreateExpandedParameterSet.Parameters.Name | Should -Contain OdataId $CreateExpandedParameterSet.Parameters.Name | Should -Contain AdditionalProperties $CreateExpandedParameterSet.Parameters.Name | Should -Not -Contain BodyParameter + $NewMgApplicationOwnerByRef.Parameters.OdataId.ParameterSets.CreateExpanded.IsMandatory | Should -be $true } It 'Should have Create parameterSet' { @@ -45,5 +46,6 @@ Describe "New-MgApplicationOwnerByRef" { $CreateViaIdentityExpandedParameterSet.Parameters.Name | Should -Contain OdataId $CreateViaIdentityExpandedParameterSet.Parameters.Name | Should -Contain AdditionalProperties $CreateViaIdentityExpandedParameterSet.Parameters.Name | Should -Not -Contain BodyParameter + $NewMgApplicationOwnerByRef.Parameters.OdataId.ParameterSets.CreateViaIdentityExpanded.IsMandatory | Should -be $true } } diff --git a/src/Applications/v1.0/test/Update-MgApplication.Tests.ps1 b/src/Applications/v1.0/test/Update-MgApplication.Tests.ps1 index 40e71344940..074757f0ff0 100644 --- a/src/Applications/v1.0/test/Update-MgApplication.Tests.ps1 +++ b/src/Applications/v1.0/test/Update-MgApplication.Tests.ps1 @@ -13,7 +13,7 @@ Describe "Update-MgApplication" { } It "Should support UpdateExpanded parameterSet by default" { - $UpdateMgApplication.OutputType | Should -Be "System.Boolean" + $UpdateMgApplication.OutputType | Should -Be "Microsoft.Graph.PowerShell.Models.IMicrosoftGraphApplication" $UpdateMgApplication.DefaultParameterSet | Should -Be "UpdateExpanded" } diff --git a/src/Users/v1.0/test/Set-MgUserManagerByRef.Tests.ps1 b/src/Users/v1.0/test/Set-MgUserManagerByRef.Tests.ps1 new file mode 100644 index 00000000000..16589e4a516 --- /dev/null +++ b/src/Users/v1.0/test/Set-MgUserManagerByRef.Tests.ps1 @@ -0,0 +1,51 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +# ------------------------------------------------------------------------------ +Describe "Set-MgUserManagerByRef" { + BeforeAll { + $SetMgUserManagerByRef = Get-Command Set-MgUserManagerByRef + } + + It "Should support minimum set of parameter sets" { + $SetMgUserManagerByRef.ParameterSets.Name | Should -BeIn @("Set", "SetExpanded", "SetViaIdentity", "SetViaIdentityExpanded") + $SetMgUserManagerByRef.Visibility | Should -Be "Public" + $SetMgUserManagerByRef.CommandType | Should -Be "Function" + } + + It "Should support SetExpanded parameterSet by default" { + $SetMgUserManagerByRef.OutputType | Should -Be "System.Boolean" + $SetMgUserManagerByRef.DefaultParameterSet | Should -Be "SetExpanded" + } + + It 'Should have SetExpanded parameterSet' { + $SetExpandedParameterSet = $SetMgUserManagerByRef.ParameterSets | Where-Object Name -eq "SetExpanded" + $SetExpandedParameterSet.Parameters.Name | Should -Contain UserId + $SetExpandedParameterSet.Parameters.Name | Should -Contain OdataId + $SetExpandedParameterSet.Parameters.Name | Should -Contain AdditionalProperties + $SetExpandedParameterSet.Parameters.Name | Should -Not -Contain BodyParameter + $SetMgUserManagerByRef.Parameters.OdataId.ParameterSets.SetExpanded.IsMandatory | Should -be $true + } + + It 'Should have Set parameterSet' { + $SetParameterSet = $SetMgUserManagerByRef.ParameterSets | Where-Object Name -eq "Set" + $SetParameterSet.Parameters.Name | Should -Contain UserId + $SetParameterSet.Parameters.Name | Should -Contain BodyParameter + $SetParameterSet.Parameters.Name | Should -Not -Contain AdditionalProperties + } + + It 'Should have SetViaIdentity parameterSet' { + $SetViaIdentityParameterSet = $SetMgUserManagerByRef.ParameterSets | Where-Object Name -eq "SetViaIdentity" + $SetViaIdentityParameterSet.Parameters.Name | Should -Contain InputObject + $SetViaIdentityParameterSet.Parameters.Name | Should -Contain BodyParameter + $SetViaIdentityParameterSet.Parameters.Name | Should -Not -Contain AdditionalProperties + } + + It 'Should have SetViaIdentityExpanded parameterSet' { + $SetViaIdentityExpandedParameterSet = $SetMgUserManagerByRef.ParameterSets | Where-Object Name -eq "SetViaIdentityExpanded" + $SetViaIdentityExpandedParameterSet.Parameters.Name | Should -Contain InputObject + $SetViaIdentityExpandedParameterSet.Parameters.Name | Should -Contain OdataId + $SetViaIdentityExpandedParameterSet.Parameters.Name | Should -Contain AdditionalProperties + $SetViaIdentityExpandedParameterSet.Parameters.Name | Should -Not -Contain BodyParameter + $SetMgUserManagerByRef.Parameters.OdataId.ParameterSets.SetViaIdentityExpanded.IsMandatory | Should -be $true + } +} diff --git a/src/readme.graph.md b/src/readme.graph.md index 5e7058856df..16dbcf4a13e 100644 --- a/src/readme.graph.md +++ b/src/readme.graph.md @@ -514,6 +514,19 @@ directive: } } } +# Mark '@odata.id' as required properties for /$ref. + - from: 'openapi-document' + where: $.components.schemas.ReferenceCreate + transform: $['required'] = ['@odata.id'] + - from: 'openapi-document' + where: $.components.schemas.ReferenceCreate..properties['@odata.id'] + transform: $['description'] = 'The entity reference URL of the resource. For example, https://graph.microsoft.com/v1.0/directoryObjects/{id}.' + - from: 'openapi-document' + where: $.components.schemas.ReferenceUpdate + transform: $['required'] = ['@odata.id'] + - from: 'openapi-document' + where: $.components.schemas.ReferenceUpdate..properties['@odata.id'] + transform: $['description'] = 'The entity reference URL of the resource. For example, https://graph.microsoft.com/v1.0/directoryObjects/{id}.' # Mark consistency level parameter as required for /$count paths when header is present. - from: openapi-document where: $..paths.*[?(/(.*_GetCount)/gmi.exec(@.operationId))]..parameters[?(@.name === "ConsistencyLevel")]