Skip to content

Migrate graph commands to Zod#7371

Open
waldekmastykarz wants to merge 1 commit into
pnp:mainfrom
waldekmastykarz:waldekmastykarz/migrate-graph-commands-to-zod
Open

Migrate graph commands to Zod#7371
waldekmastykarz wants to merge 1 commit into
pnp:mainfrom
waldekmastykarz:waldekmastykarz/migrate-graph-commands-to-zod

Conversation

@waldekmastykarz
Copy link
Copy Markdown
Member

What's in this PR

Migrates all remaining graph commands from the legacy options/validators pattern to Zod schema validation, closing #7305.

Commands migrated

  • graph schemaextension get
  • graph schemaextension add
  • graph schemaextension remove
  • graph schemaextension list
  • graph schemaextension set
  • graph subscription add
  • graph changelog list

Changes

  • Replaced #initOptions(), #initValidators(), #initTelemetry() with z.strictObject() schemas
  • Used z.enum() for predefined values (status, TLS versions, etc.)
  • Used .refine() via getRefinedSchema() for custom validation (GUID checks, JSON properties validation, URL format, date ranges)
  • Updated all 7 spec files to use commandOptionsSchema.safeParse() pattern
  • Removed legacy supports specifying test that tested old infrastructure

Verification

  • ✅ Build passes
  • ✅ Lint passes
  • ✅ All tests pass
  • ✅ 100% coverage on graph commands

Migrates all remaining graph commands from legacy options/validators
pattern to Zod schema validation:

- schemaextension-get, -add, -remove, -list, -set
- subscription-add
- changelog-list

Replaces #initOptions(), #initValidators(), #initTelemetry() with
Zod schemas using z.strictObject(), z.enum(), .refine(), and
getRefinedSchema(). Updates all corresponding spec files to use
commandOptionsSchema.safeParse() pattern.

Closes pnp#7305

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@waldekmastykarz waldekmastykarz linked an issue May 28, 2026 that may be closed by this pull request
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate graph commands to Zod

1 participant