Skip to content

Bug report: for spo list commands, the option listTitle is not enforced as string #6620

@milanholemans

Description

@milanholemans

Priority

(Medium) I'm annoyed but I'll live

Description

When trying to attach a SharePoint webhook to a library whose name is a number, the command fails.

Image

This is because the request body looks like this:

{
  "resource": 2025,
  "notificationUrl": "https://something.example.com",
  "expirationDateTime": "2025-08-28T19:13:56.181Z"
}

The resource parameter should be a string, and not a number.

Steps to reproduce

Use list webhook add on a library whose name is a number.

Expected results

Webhook attached.

Actual results

Cannot convert a primitive value to the expected type 'Edm.String'. See the inner exception for more details.

Diagnostics

No response

CLI for Microsoft 365 version

10.4.0

nodejs version

22.14.0

Operating system (environment)

Windows

Shell

PowerShell

cli doctor

No response

Additional Info

Instead of only force typing the listTitle parameter, let's type every parameter correctly to avoid more problems.
I also suggest that we do this for every spo list command to prevent problems like these from happening.

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