Skip to content

Make function property values camelCase#1591

Open
SteveL-MSFT wants to merge 9 commits into
PowerShell:mainfrom
SteveL-MSFT:functions-casing
Open

Make function property values camelCase#1591
SteveL-MSFT wants to merge 9 commits into
PowerShell:mainfrom
SteveL-MSFT:functions-casing

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

PR Summary

Function Category and ArgKind should be camelCase

PR Context

Fix #1582

@SteveL-MSFT SteveL-MSFT requested review from Copilot and michaeltlombardi and removed request for Copilot June 20, 2026 13:57
Copilot AI review requested due to automatic review settings June 21, 2026 00:21

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 addresses issue #1582 by changing how function metadata enum values are serialized so that dsc function list (and related schema generation) emits camelCase string values instead of PascalCase.

Changes:

  • Serialize FunctionArgKind enum variants using camelCase (e.g., Stringstring, Nullnull).
  • Serialize FunctionCategory enum variants using camelCase (e.g., Systemsystem).
  • Add a Pester test intended to validate camelCase naming in generated schemas (needs adjustment to allow reserved _camelCase fields).

Reviewed changes

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

File Description
lib/dsc-lib/src/functions/mod.rs Applies serde(rename_all = "camelCase") to function metadata enums so CLI output/schema enum values become camelCase.
dsc/tests/dsc_schema.tests.ps1 Adds a schema-wide camelCase validation test (currently too strict for underscore-prefixed reserved fields; should be relaxed).
Comments suppressed due to low confidence (1)

lib/dsc-lib/src/functions/mod.rs:111

  • These enums now serialize their variants as camelCase (e.g. Resource -> resource, String -> string). That will break existing Pester expectations that currently assert PascalCase values for dsc function list output (e.g. dsc/tests/dsc_function_list.tests.ps1:18-22) and MCP list_dsc_functions expectations (e.g. dsc/tests/dsc_server.tests.ps1:259-261). Please update those tests (and any other consumers) to match the new serialized values so CI doesn’t fail.
/// The kind of argument that a function accepts.
#[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Serialize, JsonSchema, DscRepoSchema)]
#[dsc_repo_schema(base_name = "argKind", folder_path = "definitions/functions/builtin")]
#[serde(rename_all = "camelCase")]
pub enum FunctionArgKind {
    Array,
    Boolean,
    Lambda,
    Null,
    Number,
    Object,
    String,

Comment thread dsc/tests/dsc_schema.tests.ps1
@SteveL-MSFT SteveL-MSFT added the Schema-Impact Change requires updating a canonical schema for configs or manifests label Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

dsc function list field values are not camelCased

2 participants