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

Open
#6,620 8 comments 1 reaction 1 assignee View on GitHub

@Adam-it is already working on this.

Since Nov 27, 2025.

Assessment

This issue has not been assessed yet.

Description

bug work in progress
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.

Dominant language
TypeScript
Stars
1.5k
Forks
413
Avg merge
5d 6h
Merged PRs (30d)
21

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pnp/cli-microsoft365

All issues in pnp/cli-microsoft365

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.