Skip to content

Breaking change: ensure all commands don't return data wrapped in the 'value' property #2292

@appieschot

Description

@appieschot

Description

Some of our commands return values wrapped in a value object, others return the values without it. Most likely all of our list commands use the value implementation.

Steps to reproduce

Use m365 spo user list --webUrl https://contoso.sharepoint.com/ --output json and the response is

{
  "value": [
    {
      "Id": 7,
      "LoginName": "i:0#.f|membership|[email protected]",
      "Title": "Garth North",
      "PrincipalType": 1,
      "Email": "[email protected]",
      "IsEmailAuthenticationGuestUser": false,
      "IsShareByEmailGuestUser": false,
      "IsSiteAdmin": true,
      "UserId": {
        "NameId": "xxxx",
        "NameIdIssuer": "urn:federation:microsoftonline"
      },
      "UserPrincipalName": "[email protected]"
    },
    {
      "Id": 2,
      "LoginName": "i:0#.f|membership|[email protected]",
      "Title": "Admin",
      "Email": "[email protected]",
      "Expiration": "",
      "IsEmailAuthenticationGuestUser": false,
      "IsShareByEmailGuestUser": false,
      "IsSiteAdmin": true,
      "UserId": {
        "NameId": "xxxx",
        "NameIdIssuer": "urn:federation:microsoftonline"
      },
      "UserPrincipalName": "[email protected]"
    }
  ]
}

Expected result

All results return a consistent response when using the --output json. Should be something we fix for v4 of the CLI as this will be a breaking change.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions