Skip to content

v2.26.1 - New-MgPolicyClaimMappingPolicy fails with "An unexpected 'StartObject' node was found" #3227

@LijuV-MSFT

Description

@LijuV-MSFT

Describe the bug

When trying to create a claims mapping policy using New-MgPolicyClaimMappingPolicy, the command fails with:

New-MgPolicyClaimMappingPolicy : An unexpected 'StartObject' node was found for property named '' when reading from the JSON reader. A 'PrimitiveValue' node was expected.
Status: 400 (BadRequest)
ErrorCode: Request_BadRequest
Date: 2025-03-17T15:29:31
Headers:
Transfer-Encoding : chunked
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 7f72f984-be50-4425-80a5-29abd9f45483
client-request-id : dfe4284f-61d0-4854-bd2e-70efa990b41e
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"East US 2","Slice":"E","Ring":"5","ScaleUnit":"005","RoleInstance":"BN2PEPF0000758E"}}
x-ms-resource-unit : 1
Cache-Control : no-cache
Date : Mon, 17 Mar 2025 15:29:31 GMT
At line:1 char:1

  • $newPolicy = New-MgPolicyClaimMappingPolicy -BodyParameter $param
  •   + CategoryInfo          : InvalidOperation: ({ Headers = , b...MappingPolicy }:<>f__AnonymousType0`2) [New-MgPolicyClaimMappingPolicy_Create], Exception
      + FullyQualifiedErrorId : Request_BadRequest,Microsoft.Graph.PowerShell.Cmdlets.NewMgPolicyClaimMappingPolicy_Create
    
    
    

Command used:

Expected behavior

All three examples work successfully with v2.25.0

How to reproduce

  1. Install Graph modules
  2. Verify that v2.26.0 is installed
  3. Use any of the examples cited above

SDK Version

2.26.1

Latest version known to work for scenario above?

2.25.0

Known Workarounds

Install prior version of module

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions