Skip to content

Bug report: Updating a content type property with an empty value throws an exception #3718

@martinlingstuyl

Description

@martinlingstuyl

Description

If I run the following command:

m365 spo contenttype set --webUrl '<url>' --id '<some-id>' --listTitle '<some-title>' --Description ''  --debug

The command throws a 400 exception.

The reason this happens is because the Description option is translated to a boolean when calling the API:

"data": {
    "Description": true
  }

Steps to reproduce

  1. Update a content type with a description
  2. Now try to empty it by running the same command with an empty value in string quotes.

Expected results

The property is emptied.

Actual results

The command crashes.

CLI for Microsoft 365 version

5.8 (next)

nodejs version

16.15.0

Operating system (environment)

Windows

Shell

PowerShell

Additional Info

This issue does not occur on bash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions