Skip to content

Enable export operation to have own schema#1566

Open
SteveL-MSFT wants to merge 7 commits into
PowerShell:mainfrom
SteveL-MSFT:export-schema
Open

Enable export operation to have own schema#1566
SteveL-MSFT wants to merge 7 commits into
PowerShell:mainfrom
SteveL-MSFT:export-schema

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

PR Summary

Enables resources supporting export to optionally have separate schema from get, set, and test.

In the resource manifest under the export operation, there is now an optional schema property that can be:

command - same as normal schema which runs a command that returns JSON schema
embedded - same as normal schema which has embedded JSON schema
noFiltering - this string value indicates that the resource doesn't support filtering, so any user input is discarded before calling the resource

New test resource added to validate these scenarios particularly where the name property is an enum, but the export allows name to be an arbitrary string to allow passing in wildcards.

PR Context

Fix #1232

Copilot AI review requested due to automatic review settings June 10, 2026 04:29
@SteveL-MSFT SteveL-MSFT added Doc-Impact Schema-Impact Change requires updating a canonical schema for configs or manifests labels Jun 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 implements support for an optional export.schema override in resource manifests, allowing resources to validate export input using a different schema than get/set/test (including a noFiltering mode), and adds test resources + Pester coverage to validate wildcard filtering scenarios (Issue #1232).

Changes:

  • Extend the resource manifest model to allow export.schema with command, embedded, or noFiltering.
  • Update export invocation to validate export input against the export-specific schema (or discard input for noFiltering).
  • Add dsctest fixtures/resources and a new Pester test to validate command/embedded/noFiltering export schema behaviors.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/dsctest/src/main.rs Wires up a new export-schema subcommand and exposes schemas used by the new test resources.
tools/dsctest/src/export_schema.rs Adds a test implementation that exercises export filtering with wildcard-capable input.
tools/dsctest/src/args.rs Adds CLI surface for export-schema and schema generation for export/get vs export input schemas.
tools/dsctest/dsctest.dsc.manifests.json Adds three new test resources covering export schema via command, embedded schema, and noFiltering.
tools/dsctest/Cargo.toml Adds regex dependency for wildcard filtering in the test helper.
lib/dsc-lib/src/dscresources/resource_manifest.rs Introduces ExportSchemaKind and adds schema to the manifest export operation model.
lib/dsc-lib/src/dscresources/command_resource.rs Implements export-specific schema resolution and export-input validation / noFiltering behavior.
lib/dsc-lib-jsonschema/.versions.json Bumps jsonschema patch version metadata (V3_2_2).
dsc/tests/dsc_resource_export.tests.ps1 Adds Pester tests validating export input behavior across the new test resources.
Cargo.lock Locks the new regex dependency for dsctest.

Comment thread lib/dsc-lib/src/dscresources/command_resource.rs Outdated
Comment thread lib/dsc-lib/src/dscresources/command_resource.rs
Comment thread tools/dsctest/src/export_schema.rs
Comment thread tools/dsctest/dsctest.dsc.manifests.json
SteveL-MSFT and others added 2 commits June 10, 2026 10:07
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Comment thread lib/dsc-lib/src/dscresources/command_resource.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Doc-Impact Schema-Impact Change requires updating a canonical schema for configs or manifests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

export should have its own schema

2 participants