Skip to content

Fixes unrecognized key error when using aliases. Closes #7064#7069

Merged
milanholemans merged 1 commit intopnp:mainfrom
Saurabh7019:issue-7064
Dec 16, 2025
Merged

Fixes unrecognized key error when using aliases. Closes #7064#7069
milanholemans merged 1 commit intopnp:mainfrom
Saurabh7019:issue-7064

Conversation

@Saurabh7019
Copy link
Copy Markdown
Contributor

Closes #7064

@Saurabh7019 Saurabh7019 marked this pull request as ready for review December 14, 2025 19:50
Copilot AI review requested due to automatic review settings December 14, 2025 19:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in the zod schema validation for SPE container commands where optional parameters with aliases were not being recognized correctly. The issue was caused by calling .optional() outside of zod.alias() instead of inside the type definition.

  • Fixed the placement of .optional() to be inside the type parameter of zod.alias() calls
  • Applied the fix to three optional aliased parameters across two command files
  • Makes the code consistent with the established pattern used throughout the codebase

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/m365/spe/commands/container/container-remove.ts Fixed id and name optional aliased parameters by moving .optional() inside the type definition
src/m365/spe/commands/container/container-add.ts Fixed description optional aliased parameter by moving .optional() inside the type definition

@milanholemans
Copy link
Copy Markdown
Contributor

Thanks, we'll review it soon!

@milanholemans milanholemans self-assigned this Dec 16, 2025
Copy link
Copy Markdown
Contributor

@milanholemans milanholemans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing to add!

@milanholemans milanholemans merged commit 91db44d into pnp:main Dec 16, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug report: 'spe container remove' fails with unrecognized key error when using aliases

3 participants