Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request migrates the SharePoint Online spo contenttype* command set from the legacy validators/options model to the Zod-based schema model used by the CLI core, aligning these commands with the newer validation and parsing pipeline (issue #7323).
Changes:
- Added Zod option schemas (and refined schemas for option-set rules) to the
spo contenttype*andspo contenttypehub getcommands. - Updated unit tests to parse action options through
command.getSchemaToParse()and added unknown-option validation tests where schemas are strict. - Removed legacy
#initOptions/#initValidators/#initTypes/#initOptionSetsplumbing from migrated commands.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/m365/spo/commands/contenttypehub/contenttypehub-get.ts | Adds a Zod schema for global options and exposes it via schema. |
| src/m365/spo/commands/contenttypehub/contenttypehub-get.spec.ts | Updates tests to parse options through the command’s schema; adds strict unknown-option tests. |
| src/m365/spo/commands/contenttype/contenttype-sync.ts | Replaces legacy validation/optionSets with Zod schema + refined option-set rules. |
| src/m365/spo/commands/contenttype/contenttype-sync.spec.ts | Updates tests to use schema parsing and schema-based validation checks. |
| src/m365/spo/commands/contenttype/contenttype-set.ts | Introduces Zod schema (with catchall) + refined rules and keeps allowUnknownOptions() for dynamic update payload. |
| src/m365/spo/commands/contenttype/contenttype-set.spec.ts | Updates tests to use schema parsing and schema-based validation checks. |
| src/m365/spo/commands/contenttype/contenttype-remove.ts | Migrates options/validation to Zod schema + refined option-set rule. |
| src/m365/spo/commands/contenttype/contenttype-remove.spec.ts | Updates tests to use schema parsing and schema-based validation checks; adds strict unknown-option test. |
| src/m365/spo/commands/contenttype/contenttype-list.ts | Migrates options/validation to a strict Zod schema. |
| src/m365/spo/commands/contenttype/contenttype-list.spec.ts | Updates tests to use schema parsing and adds strict unknown-option test. |
| src/m365/spo/commands/contenttype/contenttype-get.ts | Migrates options/validation to strict Zod schema + refined option-set rule. |
| src/m365/spo/commands/contenttype/contenttype-get.spec.ts | Updates tests to use schema parsing and adds strict unknown-option test. |
| src/m365/spo/commands/contenttype/contenttype-field-set.ts | Migrates options/validation to strict Zod schema (including boolean options). |
| src/m365/spo/commands/contenttype/contenttype-field-set.spec.ts | Updates tests to use schema parsing and schema-based validation checks. |
| src/m365/spo/commands/contenttype/contenttype-field-remove.ts | Migrates options/validation to strict Zod schema (incl. GUID + SP URL validations). |
| src/m365/spo/commands/contenttype/contenttype-field-remove.spec.ts | Updates tests to use schema parsing and schema-based validation checks. |
| src/m365/spo/commands/contenttype/contenttype-field-list.ts | Migrates options/validation to strict Zod schema + refined option-set rules. |
| src/m365/spo/commands/contenttype/contenttype-field-list.spec.ts | Updates tests to use schema parsing and adds strict unknown-option test. |
| src/m365/spo/commands/contenttype/contenttype-add.ts | Migrates options/validation to strict Zod schema for add command parameters. |
| src/m365/spo/commands/contenttype/contenttype-add.spec.ts | Updates tests to use schema parsing and adds strict unknown-option test. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
milanholemans
marked this pull request as draft
October 16, 2026 22:15
Contributor
|
Could you resolve the conflict? |
MartinM85
force-pushed
the
feature/7322-migrate-spo-contenttype-commands-to-zod
branch
from
October 17, 2026 08:29
7b63af9 to
6cb56a9
Compare
MartinM85
marked this pull request as ready for review
October 17, 2026 08:56
Contributor
Author
Resolved |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7323